No minus symbol for negative tick labels when saving as PDF
See original GitHub issueI ran into a bug that only occurs when using seaborn. If I make a plot with negative y tick labels, I can save it as a pdf and it works fine:
import matplotlib.pyplot as plt
plt.plot([-1,1], [-1,1])
plt.savefig('~/Desktop/test1.pdf')
But if I import seaborn, the negative symbols on the y-axis disappear:
import seaborn as sns
plt.savefig('~/Desktop/test1_sns.pdf')
Saving as PNG works fine
plt.savefig('~/Desktop/test1_sns_png.png')

I just upgraded to matplotlib 2.0.0, but this error occured in graphs created before that. I’m using Python 3.5.2 on Linux Mint 18.1 (based on Ubuntu 16.04LTS)
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Conversion of unicode minus sign ( from matplotlib ticklabels )
If the label is a string or a positive number, there is no problem: a unicode string is returned, I test it (or...
Read more >Unicode minus — Matplotlib 3.6.2 documentation
By default, tick labels at negative values are rendered using a Unicode minus (U+2212) rather than an ASCII hyphen (U+002D). This can be...
Read more >FAQ-992 How can I use a "real" minus sign to my axis tick ...
In these versions, the short single-hyphen symbol ("-") is the default "minus" sign. To display a "long minus", use the page.longminus ...
Read more >gnuplot 5.5
set minussign tells gnuplot to use a special symbol in the current encoding to replace the ascii character '-' in negative numbers.
Read more >How to put en dashes instead of hyphens for a negative ...
Right picture is what I usually have: hyphens are used on the y-axis negative numbers. I need to change this in a purpose...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A workaround is to save the figure as ‘eps’ and then convert it afterwards to ‘pdf’. This keeps the ‘-’ sign.
@sbanerjee23 I appreciate that venting your frustrations can feel nice, but if you actually read the thread you’ll learn that the problem is outside the scope of seaborn and that you should ask elsewhere.