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
[Bug]: Using rasterized=True with zorder makes the generated SVG have wrong axes layer hierarchy #32174
Hi, while using rasterized=True with the zorder, the saved svg files have a wrong axes layer hierarchy:
However, interestingly if another drawing command is called after such as ax.scatter(x=[], y=[], rasterized=False, zorder=10) with the same zorder but without rasterization, the generated svg file has correct layer hierarchy.
My guess is that this is related to an optimization to reduce the total number of raster images in the output, but to be clear that is a guess without having looked at the code in question recently.
Looking into this. I'll start from the SVG backend rasterization grouping and try to keep sibling axes from nesting when rasterized=True is used with zorder.
Thanks, for pointing that out. Yes I did mean to contribute the fix upstream. I started by opening the request on my fork while I was testing the changes.
I also noticed that issue #32311 is now linked to this one. I will look at that approach. Compare it with my own changes before I open a pull request upstream. That way I can make sure I’m not doing work.
Activity
SouravVerma-art commentedon Aug 6, 2026
hii @ahmedselim2017 can you assign this issue to me
SouravVerma-art commentedon Aug 6, 2026
I'd like to work on this. I'll look into backend_svg.py and the rasterization group handling
tacaswell commentedon Aug 6, 2026
We do not assign issues.
My guess is that this is related to an optimization to reduce the total number of raster images in the output, but to be clear that is a guess without having looked at the code in question recently.
QuLogic commentedon Aug 15, 2026
@SouravVerma-art you seem to have opened and merged a PR to your own fork, but not here; were you intending to open one here?
ShamikOfficial commentedon Sep 7, 2026
Looking into this. I'll start from the SVG backend rasterization grouping and try to keep sibling axes from nesting when rasterized=True is used with zorder.
SouravVerma-art commentedon Sep 23, 2026
Thanks, for pointing that out. Yes I did mean to contribute the fix upstream. I started by opening the request on my fork while I was testing the changes.
I also noticed that issue #32311 is now linked to this one. I will look at that approach. Compare it with my own changes before I open a pull request upstream. That way I can make sure I’m not doing work.
FIX: flush rasterization before SVG close_group