Friday, November 18, 2005

Paint with all the colours of the wind


Here's a function I wrote in R to help me pick colours when producing beautiful graphs:

showcol <- function(col) {
co <- colors()[grep(col,colors())]
thickness <- floor(400/length(co))
par(mar=c(1,8,1,1))
par(las=1)
plot(0,0,type="n",xlim=c(0,1),
ylim=c(1,length(co)),axes=FALSE,
xlab="",ylab="")
mtext(co,line=1,side=2,at=1:length(co),cex=0.7)
for (i in 1:length(co)) {
segments(0,i,1,i,col=co[i],lwd=thickness)
}
}

To produce the figure at right, you simply call

showcol("brown")

Some of those don't look all that brown to me ...

P.S. I couldn't figure out how to get Blogger to keep my indentation in the code above, but at least you can copy and paste this directly into R and it works. And I got to learn all about CSS.
Bookmark and Share

2 Comments:

Blogger pakescorts646 said...

Escorts in Pakistan services only employ ladies that are certified and pass our strict requirements. You are our respected client hence why we offer ladies who will leave a permanent impression in any public appearance. Pakistani Escorts have an attractive sexual attraction, and their natural appearance is just too charming to look at.

1:09 PM, June 01, 2018  
Blogger landy morris said...

am here to share with you my life experience on how a great man called Dr gbojie saved me and my marriage.I have been Married & Barren for for 5 years i had no child. i have never been pregnant i was a subject of laughter from my Friends & neighbors, i almost lost my marriage because of this issue.i was so confused that i did not know what to do until i came across this great Dr online and i contacted him at once i was scared weather it was going to work because i never believed things like this before, so i decided to give it a try and i did all what Dr gbojie asked of me and today to my greatest surprise i took in the first time and i gave birth to a bouncing baby boy and now my marriage that was about crashing before is now restored. my husband now love and want me better, Am so happy for everything that have been happening in my life since i met this Dr gbojie .I want to tell all the women/men out there who have a similar situation like mine,that the world is not over YET they should dry up their tears and contact this great man and their problem will be gone you can also contact Dr gbojie , here is how you can contact him gbojiespiritualtemple@gmail.com or contact him via his whatsapp phone number +2349066410185.or contact him on his website : http://gbojiespiritualtemple.website2.me

5:51 AM, October 06, 2018  

Post a Comment

<< Home