-
-
Notifications
You must be signed in to change notification settings - Fork 704
Open
Labels
Description
Steps To Reproduce
- Run the following minimal example in SageMath:
P = bar_chart([1, 2, 3],
rgbcolor='blue',
zorder=10, # Should place bars on top
gridlines=True,
gridlinesstyle={'color': 'gray', 'lw': 1, 'zorder': 0}) # Grid behind
P.show()- Observe the resulting plot;
- Notice that the gridlines appear above the bars, despite
zorder=10.
Expected Behavior
- Bars should be drawn above the gridlines when the user provides a larger
zorder, such aszorder=10. - The
zorderoption should control drawing order, consistent with Matplotlib and other Sage graphics primitives.
Actual Behavior
- The
zorderoption is ignored; - Users cannot control the drawing order of bars using the
zorderparameter.
Additional Information
Suggested fix
Modify the _render_on_subplot method to forward the zorder option:
subplot.bar(
ind,
datalist,
color=color,
width=width,
label=options['legend_label'],
zorder=options.get('zorder', None) # <<< FIX
)Environment
- OS: Arch Linux x86_64
- Sage Version: 10.5
Checklist
- I have searched the existing issues for a bug report that matches the one I want to file, without success.
- I have read the documentation and troubleshoot guide