Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
Bug summary
When saving certain outputs using Latex rendering as an SVG, it produces wrong outputs. Using plt.show() it renders correctly, and it works for saving as a PDF, but saving the output as a SVG math environment characters can render in the wrong size (see attached screenshots.)
Code for reproduction
frompathlibimportPathimportpandasaspdimportmatplotlib.pyplotaspltimportscienceplotsBASE_PATH=Path(__file__).parentDATA_PATH=BASE_PATH/"ion_ranges.csv"plt.style.use(['science','latex-siunitx'])dat=pd.read_csv(DATA_PATH)plt.plot(dat["energy"],dat["projected_range_um"],marker="o",linestyle="-")plt.xlabel("Energy (keV)")plt.ylabel(r"Projected Range (\si{\um})")plt.tight_layout()plt.savefig(BASE_PATH/"ion_ranges_plot.pdf")
Actual outcome
Expected outcome
Additional information
No response
Operating system
No response
Matplotlib Version
3.10.1
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None