Skip to content

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

Closed

Description

@urogers

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

Activity

  1. 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[/+] on May 6, 2019
  2. QuLogic commented on May 6, 2019

    @QuLogic
    Member

    Matplotlib version: 2.2.2

    This version is fairly old; please try with 3.0.2.

  3. ImportanceOfBeingErnest commented on May 6, 2019

    @ImportanceOfBeingErnest
    Member

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

    It bisects to #11381

  4. added this to the v3.2.0 milestone on May 6, 2019
  5. anntzer commented on May 7, 2019

    @anntzer
    Contributor

    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}.)

  6. ImportanceOfBeingErnest commented on May 7, 2019

    @ImportanceOfBeingErnest
    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.

  7. anntzer commented on May 7, 2019

    @anntzer
    Contributor

    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?

  8. ImportanceOfBeingErnest commented on May 7, 2019

    @ImportanceOfBeingErnest
    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.
    
  9. anntzer commented on May 7, 2019

    @anntzer
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions