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
{{ message }}
Repository navigation
Avoid argument explosion in plotting functions #956
I support the idea of tidying up plotting arguments. I think there are mainly two problems. 1) the high number of plotting arguments 2) lack of reusability of plotting "styles".
Chaining looks really cool and improves 1). Also, it logically partitions the plotting arguments. However, it doesn't solve 2). In other words, if we plot two figures, we'll need to copy the entire thing, and it'll be very verbose:
I like the idea and I see your point, however I wonder how intuitive the concept of a style is for beginners. Also you'd have to know exactly what you are looking to plot during your analysis to set up a style for all plots for the future (e.g. do you need arrows? Will you use a marker gene dotplot?). Context managers definitely look clean (I love that I have my own ^^), but it would make things a bit more difficult for beginners to get an intuitive feel for scanpy.
@gokceneraslan indeed styling needs to be addressed and your solution seems quite interesting however, I don't know how complicated is to implement something like this.
My suggestion would be to try the chaining first at least with some functions to see how practical is this. Maybe @VolkerBergen that is revising the scatter plots can try some initial steps?
Activity
LuckyMD commentedon Dec 17, 2019
I love this! Question from my side would be how to best make docs for this. Might fragment the documentation too much if we're not careful with this.
fidelram commentedon Dec 18, 2019
With respect to documentation: each plotting function becomes a module with well described functions. An example is the styling of pandas DataFrames (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.io.formats.style.Styler.html)
LuckyMD commentedon Dec 18, 2019
That looks really good!
gokceneraslan commentedon Dec 19, 2019
I support the idea of tidying up plotting arguments. I think there are mainly two problems. 1) the high number of plotting arguments 2) lack of reusability of plotting "styles".
Chaining looks really cool and improves 1). Also, it logically partitions the plotting arguments. However, it doesn't solve 2). In other words, if we plot two figures, we'll need to copy the entire thing, and it'll be very verbose:
One thing that comes to mind for reusability is to store the result of the chain somewhere and, well, reuse it:
WDYT?
LuckyMD commentedon Dec 19, 2019
I like the idea and I see your point, however I wonder how intuitive the concept of a style is for beginners. Also you'd have to know exactly what you are looking to plot during your analysis to set up a style for all plots for the future (e.g. do you need arrows? Will you use a marker gene dotplot?). Context managers definitely look clean (I love that I have my own ^^), but it would make things a bit more difficult for beginners to get an intuitive feel for scanpy.
fidelram commentedon Jan 16, 2020
@gokceneraslan indeed styling needs to be addressed and your solution seems quite interesting however, I don't know how complicated is to implement something like this.
My suggestion would be to try the chaining first at least with some functions to see how practical is this. Maybe @VolkerBergen that is revising the scatter plots can try some initial steps?
[WIP] Attempt as using chaining to reduce parameters (as suggested in #…
improvements on plotting functions that use 'groupby' (#1210)