Changes titles in ggplot2 plot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Changes titles in ggplot2 plot

Shige Song
Dear Colleagues,

In the following simple ggplot2 code:
--------------------------------
m <- ggplot(d.fig, aes(time, prob))
m + stat_summary(fun.data = "median_hilow", conf.int = .95, geom =
"smooth") + facet_wrap(~ Cohort, nrow=1) + coord_cartesian(ylim = c(0,
.03))
--------------------------------
Is there a way to replace the y-axis label from "prob" to "Predicted
Probability" and replace the x-axis label from "time" to "Time
Elapsed"?

Many thanks.

Best,
Shige

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Changes titles in ggplot2 plot

Felipe Carrillo
you can just probably add
+ labs(x="Time Elapsed,y="Predicted Probability")
 
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
http://www.fws.gov/redbluff/rbdd_jsmp.aspx




----- Original Message ----

> From: Shige Song <[hidden email]>
> To: r-help Help <[hidden email]>
> Sent: Sat, February 12, 2011 7:07:39 PM
> Subject: [R] Changes titles in ggplot2 plot
>
> Dear Colleagues,
>
> In the following simple ggplot2 code:
> --------------------------------
> m <- ggplot(d.fig, aes(time, prob))
> m + stat_summary(fun.data = "median_hilow", conf.int = .95, geom =
> "smooth") + facet_wrap(~ Cohort, nrow=1) + coord_cartesian(ylim = c(0,
> .03))
> --------------------------------
> Is there a way to replace the y-axis label from "prob" to "Predicted
> Probability" and replace the x-axis label from "time" to "Time
> Elapsed"?
>
> Many thanks.
>
> Best,
> Shige
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


 
____________________________________________________________________________________
Now that's room service!  Choose from over 150,000 hotels
in 4[[elided Yahoo spam]]
hoo.com/promo-generic-14795097

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Changes titles in ggplot2 plot

Shige Song
Dear Felipe,

Thank you very much, this is exactly what I need (did find it in the
ggplot2 book).

Best,
Shige

On Sat, Feb 12, 2011 at 10:19 PM, Felipe Carrillo
<[hidden email]> wrote:

> you can just probably add
> + labs(x="Time Elapsed,y="Predicted Probability")
>
> Felipe D. Carrillo
> Supervisory Fishery Biologist
> Department of the Interior
> US Fish & Wildlife Service
> California, USA
> http://www.fws.gov/redbluff/rbdd_jsmp.aspx
>
>
>
>
> ----- Original Message ----
>> From: Shige Song <[hidden email]>
>> To: r-help Help <[hidden email]>
>> Sent: Sat, February 12, 2011 7:07:39 PM
>> Subject: [R] Changes titles in ggplot2 plot
>>
>> Dear Colleagues,
>>
>> In the following simple ggplot2 code:
>> --------------------------------
>> m <- ggplot(d.fig, aes(time, prob))
>> m + stat_summary(fun.data = "median_hilow", conf.int = .95, geom =
>> "smooth") + facet_wrap(~ Cohort, nrow=1) + coord_cartesian(ylim = c(0,
>> .03))
>> --------------------------------
>> Is there a way to replace the y-axis label from "prob" to "Predicted
>> Probability" and replace the x-axis label from "time" to "Time
>> Elapsed"?
>>
>> Many thanks.
>>
>> Best,
>> Shige
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
> ____________________________________________________________________________________
> Now that's room service!  Choose from over 150,000 hotels
> in 45,000 destinations on Yahoo! Travel to find your fit.
> http://farechase.yahoo.com/promo-generic-14795097
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.