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
In this simple form, reverse would be a creation-time setting, which could not be changed afterwards. But I think this is ok for now. Reversing at runtime would need a bit more code restructuring.
Sorry I didn't catch this earlier but with respect to what I had done in #19591 (and i didn't highlight that in the description, totally my fault) there's a different treatment of multiple plot calls in #24759 that came up in my production code.
What got merged in #24759 reverses the entire legend, in #19591 I only reverse a stackplot. What I do in prod is call plot once with a line plot, and then call plot with a stack plot that is entirely below the previous line. (Other than the stack plot, I also want to see if the stack fills up the entire area up until the line or if there is some space left between). And for that I actually wanted that only the stack parts in the legend get filled top-most above bottom most, but the entire stack plot should still appear in the legend below line. Or more generally, subsequent calls to plot should fill the legend top to bottom like usual, and all the legend entries from a single call to plot (like a stack plot) should be reversed among themselves.
@pseyfert would an expansion/additional subsection of controlling the legend enteries section of the tutorial help? I'm thinking something like this if we expect stackplot to be the common use case?
And also/instead mayb update the reverse legend parameter doc to link, something like
reversebool, default: False
If True, the legend labels are displayed in reverse order from the input. If False, the legend labels are displayed in the
same order as the input. For more complex orderings, see :doc:=/tutorials/intermediate/legend_guide.html#controlling-the-legend-entries
Activity
zmwaris1 commentedon Dec 14, 2022
Hi, @timhoffm I would like to take up this issue, can you assign this to me please?
jklymak commentedon Dec 14, 2022
@zmwaris1 we do not assign issues. Thanks!
melissawm commentedon Dec 15, 2022
@zmwaris1 feel free to work on it by submitting a pull request. Cheers!
zmwaris1 commentedon Dec 15, 2022
thanks @melissawm @jklymak
pseyfert commentedon Dec 27, 2022
Sorry I didn't catch this earlier but with respect to what I had done in #19591 (and i didn't highlight that in the description, totally my fault) there's a different treatment of multiple plot calls in #24759 that came up in my production code.
What got merged in #24759 reverses the entire legend, in #19591 I only reverse a stackplot. What I do in prod is call
plotonce with a line plot, and then callplotwith a stack plot that is entirely below the previous line. (Other than the stack plot, I also want to see if the stack fills up the entire area up until the line or if there is some space left between). And for that I actually wanted that only the stack parts in the legend get filled top-most above bottom most, but the entire stack plot should still appear in the legend below line. Or more generally, subsequent calls toplotshould fill the legend top to bottom like usual, and all the legend entries from a single call to plot (like a stack plot) should be reversed among themselves.jklymak commentedon Dec 27, 2022
@pseyfert At some point you are going to need to do things manually. Stackplots do not naturally only have one order to the legend entries.
story645 commentedon Dec 27, 2022
@pseyfert would an expansion/additional subsection of controlling the legend enteries section of the tutorial help? I'm thinking something like this if we expect stackplot to be the common use case?
And also/instead mayb update the reverse legend parameter doc to link, something like