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

Show choices together with options on the left? #39

Open
LukasWallrich opened this issue Jan 30, 2024 · 2 comments
Open

Show choices together with options on the left? #39

LukasWallrich opened this issue Jan 30, 2024 · 2 comments

Comments

@LukasWallrich
Copy link

Thanks for this great package! I understand that the charts are based on ggplot2 defaults - but would it be possible to shift the choices to be displayed together with their levels on the left? Given how closely they belong together, that would seem to make it much more readable, as in the example below (unfortunately created with base R plots, code here?

image

@LukasWallrich
Copy link
Author

LukasWallrich commented Jan 30, 2024

I now tried to work this out, and it's easier than I thought (with a single level of variables at least) - so here for reference for anyone who might also be looking for that. It might be worth adding this as an option to the plot ...

[I am 'abusing' this to replace a forest plot in a large meta-analysis ... otherwise, there would hopefully never be so many datapoints.]

    facet_grid(key ~ ., scales = "free_y", space = "free_y", switch = "y") +
    theme(axis.line = element_line(size = 0.5), 
          legend.position = "none",
          panel.spacing = unit(0.75, "lines"), 
          axis.text = element_text(color = "black"),
          strip.text.y.left = element_text(angle = 90, face="bold"),
          strip.background = element_rect(fill="lightblue", colour="black",size=1),
          strip.placement = "outside",
          strip.text.x = element_blank()) +

image

@masurp
Copy link
Owner

masurp commented May 22, 2024

Good point. If I have time, I will think about a way to include this option. Thanks for sharing the code.

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

2 participants