Try:
mt + facet_wrap(~cyl ,scale="free_y")
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example:
https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
(Missed the reply-all, sorry)
I am aware that this works with facet_wrap. My question is about facet_grid.
Sorry that in my attempt to provide a minimal reproducible example I have used one with a single factor so that facet_wrap does much the same thing, but I think you get the idea.
In earlier ggplot, scale="free_y" was a valid argument for facet_grid. Now it seems to have no effect?
---
Carl Boettiger
http://carlboettiger.info
sent from mobile device; my apologies for any terseness or typos
> On Jun 4, 2014 6:58 PM, "Ito, Kaori (Groton)" <Kaor...@pfizer.com> wrote:
>>
>> Try:
>>
>> mt + facet_wrap(~cyl ,scale="free_y")
>>
>>
>>
>>
>>
>> From: ggp...@googlegroups.com [mailto:ggp...@googlegroups.com] On Behalf Of Carl Boettiger
>> Sent: Wednesday, June 04, 2014 7:43 PM
>> To: ggp...@googlegroups.com
>> Subject: scales='free_y' has no effect in facet_grid?
>>
>>
>>
>> Hi folks,
>>
>>
>>
>> Maybe I'm doing something stupid here; perhaps someone can set me straight. I try (from the facet_grid documentation):
>>
>>
>>
>> mt <- ggplot(mtcars, aes(mpg, wt, colour = factor(cyl))) + geom_point()
>>
>> mt + facet_grid(. ~ cyl, scales = "free_y")
>>
>>
>>
>> and I get something like:
>>
>>
>>
In facet_grid, your are displaying multi panels by column, which is sharing the y-axis. Therefore, “free-y” does not work (I think it is expected behavior, not a bug).
If you display panels by row, y-axis is not shared, therefore, free_y works. (but I think this is not what you wanted)
mt + facet_grid(cyl~. ,scale="free_y")

Thanks!
---
Carl Boettiger
http://carlboettiger.info
sent from mobile device; my apologies for any terseness or typos