Skip to content
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

Set subplot #1 ticklabels #47

Open
araikes opened this issue Apr 12, 2022 · 2 comments
Open

Set subplot #1 ticklabels #47

araikes opened this issue Apr 12, 2022 · 2 comments

Comments

@araikes
Copy link

araikes commented Apr 12, 2022

Hi @GuangchuangYu,

Is there a way to set the tick labels for the first subplot when using scale_y_break? That function's ticklabels = argument sets the ticks for the other subplots but not the first. For instance I have a barplot where values are in the ~450-500 range, so I'm breaking at 20 and jumping to 450 but I'd like the bottom tickmarks to only be 0 and 20 not 0, 5, 10, and 20.

Thanks

@erinmgraham
Copy link

Hi @araikes, did you ever figure out how to do this? I have stacked bar and only one break and can set the ticks for the second plot but not first.

@ETaSky
Copy link

ETaSky commented Nov 15, 2024

@araikes @erinmgraham I just found out that you can directly use scale_y_continuous(breaks = c(0,20)) to set the breaks for the first part.
e.g.

ggplot(xxxx) +
scale_y_continous(breaks = c(0, 20)) + # tick label for first
scale_y_break(breaks = c(20, 450), ticklabels = c(50,400)) # tick label for second at 50 and 400

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants