If you're not happy with what R puts on the axes of your plot (tickmarks, labels etc), plot with "axes=F", then add custom axes with the "axis()" function.
You have a plot, and you want to draw a grid behind it. If you add the grid to the plot, using either
grid()or
abline(), the lines will be added on top of your plot, not behind it. I found the solution on the R-help mailing list, here. Redraw the plot after adding the grid, but first set
par(new=T)so that it will be drawn on top of the old plot on the same device.
However ironic it may be, we'll use the Iris data set as an example.
We know that the iris data set include three species. K-means does a pretty good job of correctly identifying correct groups.
data(iris) cl <- kmeans(iris[,1:4], 3) cl$cluster cbind(1:150,iris$Species)
cl$cluster reveals which group each observation was placed in; compare this with a listing of the species designations mapped next to 150 index values (cbind(1:150,iris$Species)).
This question was posed on the R-help mailing list: I would like to fill the area under a curve with a gradient of colors. Are there any packages or trick I could use?
Vladimir recommended the poster to look at the following link:
http://www.stat.auckland.ac.nz/~ihaka/Graphics/index.html
describing what Ross Ihaka, co-founder of R, has been up to of late relating to R. He's using gradients to create "really snazzy presentation graphics".
However, being an EDA snob, I have a bit of a problem with this.
This person wondered if it was possible to add a small boxplot in a histogram, like where the legend might be.