Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Saving as an SVG and PDF produce different outputs with Latex characters, with wrong character sizing #29791

Closed
@jamesmeiklejohn

Description

@jamesmeiklejohn

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

Image

Expected outcome

ion_ranges_plot.pdf

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp