[R] greyPalette() in legend plot

Jack Siegrist jacksie at eden.rutgers.edu
Wed Sep 7 16:52:50 CEST 2011


Using legend as an argument within the call to barplot will automatically
add the color key to the legend. I don't know how to add the colors using
legend separately. Try this revised code:

y <-
51.7143,40.2727,51.7692,22.3871,24.2222,24.3226,23.6342,21.5833), ncol=4)

se <-
21.7355,18.2007,26.2546,6.8199,7.2977,7.1245,7.2345,8.2616), ncol=4)

plot <- barplot(
  beside = TRUE, 
  ylim = c(0, 90), 
  axis.lty = 0.5,
  xlab = "Light treatment", 
  ylab = "root length (mm)", 
  main = "Root", 
  names.arg = c("White","Blue","Red","Far-red"),
  legend = c("Sedingehult", "Mobranna", "Aunasvare", "Fallan", "Ylinen")

segments(plot, y - se, plot, y + se)

View this message in context: http://r.789695.n4.nabble.com/greyPalette-in-legend-plot-tp3795594p3796277.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list