[R-sig-eco] Axis color change ggplot2

R Erickson raerickson at gmail.com
Sun May 3 18:03:34 CEST 2015


Hi,

This question is not ecology specific and you would probably reach more
ggplot2 experts if you asked your question on the ggplot2 Google Group:
https://groups.google.com/forum/#!forum/ggplot2

Richard Erickson

On Sat, May 2, 2015 at 8:20 PM, Luis Fernando García <luysgarcia at gmail.com>
wrote:

> 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]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list