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

Error with greek letters in pdf export when using usetex=True and mathptmx #16087

Closed
Milestone
@markushartmann

Description

@markushartmann

When I export a pdf with savefig I have errors in the greek letters, but only in the pdf the png export is fine. I use the option "usetex=True" and the package "mathptmx".

importmatplotlib.pyplotaspltfrommatplotlibimportrcimportmatplotlibrc('text',usetex=True)rc('text.latex',preamble= [r"\usepackage{mathptmx}",                           ])x=range(10)plt.figure()plt.plot(x,label=r'$\varphi$')plt.legend()plt.xlabel('abcdefgh')name=matplotlib.__version__plt.savefig('mpl_'+name+'.pdf')plt.savefig('mpl_'+name+'.png')plt.show()

With the provided code you will get a png and a pdf file. In the pdf file the \varphi symbol in the legend is only a long line. With version 2.2.4 and 1.5.3 this happens. With Version 1.4.3 the pdf and the png is fine.

Matplotlib version

  • Operating system: MacOS 10.12.6
  • Matplotlib version: 2.2.4, 1.5.3 and 1.4.3 tested
  • Matplotlib backend: MacOSX
  • Python version: 2.7.17

All instalations done via macports.

Attached the output files:

Version 1.4.3
mpl_1.4.3.pdf
mpl_1 4 3
Version 1.5.3
mpl_1.5.3.pdf
mpl_1 5 3
Version 2.2.4
mpl_2.2.4.pdf
mpl_2 2 4

Screenshot of error in pdf

Bildschirmfoto 2020-01-04 um 02 43 20

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp