-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: 3D tick label position jitter when rotating the plot view #29551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Another possible reason to consider: antialiasing. |
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 |
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. |
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? |
Or, could this be another carrot to move us off of agg to cairo?
…On Sat, Feb 1, 2025 at 3:17 PM Antony Lee ***@***.***> wrote:
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?
—
Reply to this email directly, view it on GitHub
<#29551 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHF6G6PYTIJZKJP3KX5QT2NUTWZAVCNFSM6AAAAABWFZT3V6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRZGA4TMOBQGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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.
This becomes most noticeable in animations:
https://github.com/scottshambaugh/mpl_stereo/blob/7c20f7123173eed89370ffa4227be85de514b3a3/docs/trefoil_3d_animation.gif
May be related to #13044? Though there aren't 2D rotations happening here afaik.
TODO: check if the axis labels are also affected
The text was updated successfully, but these errors were encountered: