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]: 3D tick label position jitter when rotating the plot view #29551
It seems like there is some rounding going on with 3D tick label positions. When rotating the plot, the position of the labels move around a bit. This may be intentional to line up pixel values, or it may be an artifact, but the result is "jittering" that looks bad.
changed the title [-]BUG: 3D tick label position jitter when rotating the plot view[/-][+][Bug]: 3D tick label position jitter when rotating the plot view[/+]on Jan 30, 2025
Spent some time digging into it today, and I agree this is a result of the general text rendering pipeline. Some basic edits to remove rounding in the agg backend didn't change anything, so IMO this is related to the glyph -> bitmap conversion and the associated (anti)aliasing. I wonder if there's a better way to draw the text from the vector paths? I'm getting out of my depth though.
mplcairo looks immune to the problem (from a quick look), likely because it directly renders text to the final buffer rather than going through an intermediate one like agg/ft2font does. I don't know how hard it would be to attach agg's target buffer to ft2font to do the same?
Activity
[-]BUG: 3D tick label position jitter when rotating the plot view[/-][+][Bug]: 3D tick label position jitter when rotating the plot view[/+]WeatherGod commentedon Jan 30, 2025
Another possible reason to consider: antialiasing.
timhoffm commentedon Jan 30, 2025
I would be surprised if #13044 is related because the offset for a certain text rotation angle (here 0°) is constant.
You could try a polar plot with an animated
set_theta_offset()and see whether rotating the tick labels around the polar plot jitters as well.QuLogic commentedon Jan 31, 2025
I'm pretty sure this isn't anything to do with 3D, and just that text is snapped to pixels:
If you open this GIF in GIMP, you can see that in a few frames nothing happens, and then it shifts by one pixel one way, and then one pixel the other.
scottshambaugh commentedon Feb 1, 2025
Spent some time digging into it today, and I agree this is a result of the general text rendering pipeline. Some basic edits to remove rounding in the agg backend didn't change anything, so IMO this is related to the glyph -> bitmap conversion and the associated (anti)aliasing. I wonder if there's a better way to draw the text from the vector paths? I'm getting out of my depth though.
QuLogic commentedon Feb 1, 2025
I experimented with subpixel positioning:

It's nearly there, but 1 frame out of 5 or so is a pixel out of place, so you still see a bit of jitter if you stare at it closely.
anntzer commentedon Feb 1, 2025
mplcairo looks immune to the problem (from a quick look), likely because it directly renders text to the final buffer rather than going through an intermediate one like agg/ft2font does. I don't know how hard it would be to attach agg's target buffer to ft2font to do the same?
WeatherGod commentedon Feb 2, 2025
anntzer commentedon Feb 3, 2026
Closed by #30059.