-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Support for vector hrule rendering #26337
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
base: main
Are you sure you want to change the base?
Conversation
After some discussion in our GSoC meeting, this is probably the reverse of the way to fix the issue. It appears that the raster output is shifted up when it shouldn't be (i.e., if it's a regular fraction, then all text is on the baseline, but with the test case from #23763, all text is moved up (disregarding the missing shift for the patched fraction.)) The vector output remains on the baseline for both versions. |
Possibly, the raster output needs the correct width, height, and depth to view a similar output to the vector image. The current dimensions for vector are given as: matplotlib/lib/matplotlib/_mathtext.py Lines 100 to 101 in 21e9e38
Applying the same calculations to the raster gives the following output, which is still shifted upwards and cuts off the end of the denominator text.
A few pointers from the above images:
The raster output being cut off might be caused due to the matplotlib/lib/matplotlib/_mathtext.py Lines 124 to 131 in 21e9e38
So updating
I also tinkered around with the matplotlib/lib/matplotlib/_mathtext.py Line 2459 in 21e9e38
which does improve the fraction spacing a bit, but the output shift between png and svg seems to stay put.
|
Additionally, with the above edits the #23763 example of
|
I'll have limited access to a dev machine for a few days, but can look into it after. |
I haven't looked in depth into what's happening here, but 1) skipping the int-casting (via np.ceil) for vector output would seem normal, but can (likely?) cause shifts wrt. raster output; 2) perhaps #15339 (comment) and (the last part of) #15339 (comment) may be relevant? |
PR summary
Fixes #23763
The current generated images are:
[PNG]

[SVG]

PR checklist