Skip to content

Saving polar plots with MiKTeX on Windows fails for some file formats #14146

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

Closed
urogers opened this issue May 6, 2019 · 7 comments · Fixed by #14151
Closed

Saving polar plots with MiKTeX on Windows fails for some file formats #14146

urogers opened this issue May 6, 2019 · 7 comments · Fixed by #14151

Comments

@urogers
Copy link

urogers commented May 6, 2019

Bug summary

Saving matplotlib polar plots on Windows 7 and Windows 10, with MiKTex 2.9.7.000, fails for some formats (e.g., pdf, svg) and works for others (e.g., png, jpg)

Code for reproduction

import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['text.usetex'] = True

plt.figure()
ax = plt.subplot(111, polar=True)


plt.savefig('foo.png')  # Works
plt.savefig('foo.jpg')  # Works
plt.savefig('foo.tif')  # Works
# plt.savefig('foo.pdf')  # Fails
# plt.savefig('foo.svg')  # Fails
plt.show()

Actual outcome

"Error saving .... " window pops up with error code b'tcss1000' for pdf, and b'tcss3583' for svg. (The numbers change)

Matplotlib version

  • Operating system: Windows 7 & 10
  • Matplotlib version: 2.2.2 or 3.0.3
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.6
  • Jupyter version (if applicable): N/A
  • Other libraries: N/A

Installed via Anaconda3

@urogers urogers changed the title Saving polar plots with MiKTex on Windows Fails for some formats Saving polar plots with MiKTeX on Windows fails for some file formats May 6, 2019
@QuLogic
Copy link
Member

QuLogic commented May 6, 2019

Matplotlib version: 2.2.2

This version is fairly old; please try with 3.0.2.

@ImportanceOfBeingErnest
Copy link
Member

I can reproduce this with master branch, windows 8.1 and miktex 2.9.6630.

It bisects to #11381

@anntzer
Copy link
Contributor

anntzer commented May 7, 2019

Looks like a duplicate of #10272 (try installing the cm-super tex package)?
(It may make sense to switch from computer modern to latin modern at some point, which at least has the advantage that we can check for its existence with \usepackage{lmodern}.)

@ImportanceOfBeingErnest
Copy link
Member

Installing cm-super solves this for pdf output, but not for svg. In the svg case I get

D:\****\lib\site-packages\matplotlib\textpath.py:349: UserWarning: The glyph (176) of font  
(D:/***/MiKTeX/fonts/type1/public/cm-super/sfss3583.pfb) cannot be converted with the encoding.  
Glyph may be wrong   
 "be wrong" % (glyph, font.fname))

And the output is a svg file without the ° symbols.

I think the main point here, in contrast to #10272 is, that a standard empty plot should not fail for standard latex installations.

@anntzer
Copy link
Contributor

anntzer commented May 7, 2019

Looks like if you zoom a lot, you'll see a tiny degree sign, which suggests to me that the problem is the same as the one described in #12928?

@ImportanceOfBeingErnest
Copy link
Member

Yes, with current master, the warning reads

The glyph 176 of font D:/****/MiKTeX/fonts/type1/public/cm-super/sfss3583.pfb cannot be converted with the encoding; glyph may be wrong.

@anntzer
Copy link
Contributor

anntzer commented May 7, 2019

The warning is actually spurious (per #14156), but the sizing problem is real.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants