-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Awkward interaction between faceting, polar coordinates, and free scales #2815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am also having this problem. Have you discovered a fix? I used to be able to get the faceted polar plots to show (but in skewed oval fashion). Now I can't get the code to process anymore. Has something changed with newer versions of Tidyverse? |
With the current development version of ggplot2, the reprex that Claus posted above runs with the same output that he posted above. |
I've been struggling with this same issue but located a solution to the skewed plots using
|
This did it. Thanks for the tip.
…On Tue, Jun 18, 2019 at 12:30 PM mymil ***@***.***> wrote:
I've been struggling with this same issue but located a solution to the
skewed plots using theme(aspect.ratio = 1):
https://stackoverflow.com/a/21295436/8218363
cp$is_free <- function() TRUE
ggplot(mpg, aes(x = 1, fill = drv)) +
geom_bar() +
cp +
facet_wrap(~manufacturer, scales = "free") +
theme(aspect.ratio = 1)
[image: aspect ratio_facet_pie]
<https://user-images.githubusercontent.com/33109970/59701890-2a3c8800-91bc-11e9-953a-01a40d000f8f.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2815?email_source=notifications&email_token=AGBIAYRN2AIKR25XQ2S55STP3EERVA5CNFSM4FOXW752YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX7GQKA#issuecomment-503212072>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGBIAYSAKQUVSE2WVJ5BI2DP3EERVANCNFSM4FOXW75Q>
.
|
The concept of free scales under faceting doesn't quite work the way I would think it should when we're dealing with polar coordinates.
If we make set of facets with simple polar bar plots, we get partial pies because by default the scales are the same across facets:
Trying to make the scales free, so that each facet has its own theta scale, doesn't work, because
coord_polar()
needs a fixed aspect ratio and hencecoord_polar()$is_free()
returnsFALSE
:However, we can make a version of
coord_polar()
that returnsTRUE
and it works just fine and makes the pie charts as expected. But then the aspect ratio is wrong:It seems to me that there are two separate concepts that are being muddled together, the aspect ratio of the facets and the limits of the scales. For most coordinate systems these two concepts are linked one-to-one, but for some (like
coord_polar()
) they are not.The text was updated successfully, but these errors were encountered: