controling text in facets (ggplot2)

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

controling text in facets (ggplot2)

Thomthom
Hi R-helpers!

Here is my problem:

I have a graph with 3 different facets where there are 3 different regression line. My goal is to mention separately in each facet each equation that describes my lines.

So far, I managed to add a line and the same equation to all my facets but that's not unfortunately what I want.

Is there a way to do that? Any suggestion would be gladly welcome!

Thanks for your help!

Thomas
Reply | Threaded
Open this post in threaded view
|

Re: controling text in facets (ggplot2)

djmuseR
In the absence of a reproducible example, a general question induces a
general response. I'd suggest creating a small data frame that
contains the x and y coordinates, a third variable consisting of
expressions representing each fitted model and an indicator of the
group to which the expression is to be applied. Use this data frame as
the data argument of geom_text, and set x, y and labels = variable
containing expressions as the aesthetics of the geom.

If that doesn't work, provide a reproducible example and you'll
undoubtedly get a more accurate answer. You're also more likely to get
a higher response rate if you post on the ggplot2 group:
http://had.co.nz/ggplot2/  (see the Mailing List paragraph near the
top of the page for subscription information).

Dennis

On Tue, Oct 11, 2011 at 5:45 AM, Thomthom <[hidden email]> wrote:

> Hi R-helpers!
>
> Here is my problem:
>
> I have a graph with 3 different facets where there are 3 different
> regression line. My goal is to mention separately in each facet each
> equation that describes my lines.
>
> So far, I managed to add a line and the same equation to all my facets but
> that's not unfortunately what I want.
>
> Is there a way to do that? Any suggestion would be gladly welcome!
>
> Thanks for your help!
>
> Thomas
>
> --
> View this message in context: http://r.789695.n4.nabble.com/controling-text-in-facets-ggplot2-tp3894148p3894148.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [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.
>

______________________________________________
[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.