-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
[Feature Request]: Make faceting optionally in a grid rather than just one column in tm_g_km
#665
Comments
@shajoezhu @lcd2yyz fyi |
The core issue is that "faceting" produces very disfigured (hight vs width) plots - they become very flat - and there's no one-size-fits-all setting for plot dimensions that could mitigate that. Either arrange faceting in a grid, or dynamically increase the plot height (multiply by the number of facets) could help.. |
I found out a bit more on this - facetting actually works when a factor has only few levels (e.g. gender, with two levels). If I try to facet by a variable with many more levels (e.g. treatment category), then the plot height appears to be determined by total number of levels in that factor variable - not by the actual number of levels that are present in the data. E.g. if I filter to retain only 2 treatment categories - two facet plots should still look great. But it's doing like 10 plots (because the variable has this many levels).. the resulting plots are so flat that nothing can be seen.. could one smuggle in a "drop_unused_levels" or similar within the KM model (after applying the filters, before plotting) |
One way I could guess how one could solve this: |
As a temporary fix for myself I chose to override template_g_km template_g_km . This appears to be working reasonably well for a start (i.e. one can facet plot, just need to subset to a small number of categories at a time, and plots are still a bit flat). Faceting in a grid still worth considering. |
Closes #665. Added expression that drops unused levels of faceting variable before plotting, so that empty panels are not plotted. --------- Co-authored-by: Mahmoud Hallal <mahmoud.hallal@roche.com> Co-authored-by: Mahmoud Hallal <86970066+mhallal1@users.noreply.github.com>
Currently the faceting in
tm_g_km
only works with one column. The plots get very "flat" then.Sometimes it might be better to use a grid e.g. with 2 or 3 columns.
The text was updated successfully, but these errors were encountered: