I have a boxplot for 39 species and the annual temperature values of their distribution range (bio01
). The median values are in row 3 of the boxplot$stats
. I want to color the highest median value red and the lowest blue, i.e. a temperature gradient. The code below for medcol
is not working. Can somebody suggest a solution?
b <- boxplot(bio01 ~ species, data=species.threshold.22.climate.751, las=2, ylab ="bio01", par(mar = c(18, 5,5, 2)+ 0.1), cex.names=0.2, bw = 5, medcol=b$stat[3,])
b$stats