-
Notifications
You must be signed in to change notification settings - Fork 11
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
How to drop unused categories in x axis? #32
Comments
`facet_grid` (and my derivation) are constrained that the x-axis _must_ be
the same in each column, even when using `scales = 'free_x`. Without the
latter argument, the x-axis is the same across all columns.
Similarly for y-axis for each row.
You should be looking at the `facet_wrap` function. In your case here, I am
not even sure you need my package.
lør. 25. nov. 2023 10.38 skrev msgoussi ***@***.***>:
… library(ggplot2)
library(lemon)
df <- data.frame(
v1 = c("A", "A", "A", "B", "B", "B"),
v2 = c("S1", "S2", "S3", "S7", "S8", "S9"),
nm = c(2, 3, 4, 5, 6, 7)
)
ggplot(df, aes(x = v2, y = nm)) +
geom_point(size = 3) +
facet_rep_grid(v1~., scales = "free_x", repeat.tick.labels = T)
image.png (view on web)
<https://github.com/stefanedwards/lemon/assets/18138496/b0ef06db-5c30-4ccb-aeb9-fe8a3eaf3b98>
—
Reply to this email directly, view it on GitHub
<#32>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA3NBGSVKK5GJBJAJU2C3PDYGG4CTAVCNFSM6AAAAAA7Z7F37CVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTANJUG43DAOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
library(ggplot2)
library(lemon)
df <- data.frame(
v1 = c("A", "A", "A", "B", "B", "B"),
v2 = c("S1", "S2", "S3", "S7", "S8", "S9"),
nm = c(2, 3, 4, 5, 6, 7)
)
ggplot(df, aes(x = v2, y = nm)) +
geom_point(size = 3) +
facet_rep_grid(v1~., scales = "free_x", repeat.tick.labels = T)
The text was updated successfully, but these errors were encountered: