specr icon indicating copy to clipboard operation
specr copied to clipboard

Show choices together with options on the left?

Open LukasWallrich opened this issue 2 years ago • 2 comments

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 avatar Jan 30 '24 09:01 LukasWallrich

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

LukasWallrich avatar Jan 30 '24 11:01 LukasWallrich

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

masurp avatar May 22 '24 13:05 masurp