[R-sig-eco] Axis color change ggplot2

Luis Fernando García luysgarcia at gmail.com
Sun May 3 03:20:49 CEST 2015


Dear R experts,

I have a basic question which has turned a headache for me. I want to
change the color for the axis value in a plot to blue, but it has been
impossible. In the code, I´m using, I plot the mean and Confidence
intervals (CI) values for a data summary. I followed one tutorial to change
this (http://docs.ggplot2.org/0.9.2.1/theme.html) NEvertheless, when I
apply the function to change the labels to blue, the axis names and also
the CI dissapear. I wanted to know what am I doing wrong.

Please find attached the code and the data set!

Thanks for any help you can provide!


pt
http://textuploader.com/x31y

bymean <- with(pt, reorder(PREY, -Time, mean))# REordenar por promedio

names(a)

bymean

e <- qplot(bymean, pt$Time,size=3)+theme(panel.grid.major =
element_blank(), panel.grid.minor = element_blank(),
                                           panel.background =
element_blank(), axis.line = element_line(colour = "black"))

e<-e+theme(legend.position="none")

e + theme(axis.text.x=element_text(colour="black"))

e

e+  geom_errorbar(data = pt, aes(x = pt$PREY, y = pt$Time, ymin = pt$Time -
pt$ci, ymax = pt$Time + pt$ci),
                  colour = "black", width = 0.4, size=0.5)+
  xlab("Prey") +
  ylab("Time (UNIDAD?)") +
  ggtitle("iMMOBILISATION TIME")

e + theme(axis.text = element_text(colour = "blue"))# After making this,
the error bars and axis name dissapear.

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list