You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using draw.smooth_estimates() on a GAM with sz smooths, it currently generates one plot per factor with the deviation smooths for each level layered on top of each other. As I understand it this allows for a quicker visual comparison between factor levels, however with any more than realistically 3 smooths the plot becomes quite hard to interpret. For example:
In my own fork of gratia I can separate these plots, by essentially just adding a return(sm_l) in the draw.smooth_estimates() function, and then using that returned dataframe to manually plot the smooths (using the ggplot in plot_smooth.sz_factor_smooth() with an added facet_wrap into that ggplot)
Is there any way this could be added? Not sure exactly what form it would take, or if you think it is a good idea? It is just slightly nicer to see the deviations separately, even though the main event is the final "combined" smooth where you combine the deviations so to speak (I can do this fine note).
Many thanks for all your work! Let me know if I can clarify anything
The text was updated successfully, but these errors were encountered:
This is a little more complicated to do automagically; "sz" and "fs" smooths are stored as a single smooth in the model, whereas factor by smooths are considered as entirely separate smooths and stored separately. When draw.gam() works on the smooths, it operates at this level of smooth, and expects 1 plot per element in the $smooth component of the fitted model. There's nothing stopping me returning multiple ggplot objects from the plot_smooth() methods. What is a problem is getting draw.gam() to unwrap these objects into the list of plots. I'll have to look at ways of unnesting a list but only if an element of that list contains multiple ggplot objects.
when using
draw.smooth_estimates()
on a GAM with sz smooths, it currently generates one plot per factor with the deviation smooths for each level layered on top of each other. As I understand it this allows for a quicker visual comparison between factor levels, however with any more than realistically 3 smooths the plot becomes quite hard to interpret. For example:In my own fork of gratia I can separate these plots, by essentially just adding a
return(sm_l)
in thedraw.smooth_estimates()
function, and then using that returned dataframe to manually plot the smooths (using the ggplot inplot_smooth.sz_factor_smooth()
with an added facet_wrap into that ggplot)Is there any way this could be added? Not sure exactly what form it would take, or if you think it is a good idea? It is just slightly nicer to see the deviations separately, even though the main event is the final "combined" smooth where you combine the deviations so to speak (I can do this fine note).
Many thanks for all your work! Let me know if I can clarify anything
The text was updated successfully, but these errors were encountered: