olgabot / prettyplotlib

Painlessly create beautiful matplotlib plots.
olgabot.github.io/prettyplotlib
MIT License
1.69k stars 148 forks source link

Special characters in plot #69

Closed pomxipum closed 10 years ago

pomxipum commented 10 years ago

fig1=plt.figure() ax1=fig1.gca() im1=ax1.imshow(tab_amp,cmap=cm.rainbow,extent=(0,90,-45,45),interpolation='bilinear') ax1.set_xlabel(u'\u03b8 (°)') ax1.set_ylabel(u'\u03c6 (°)') cb1=fig1.colorbar(im1) cb1.set_label(u'Amplitude de \u03b8ij (°)') cs1 = ax1.contour(tab_amp_inv,colors='k',extent=(0,90,-45,45)) ax1.clabel(cs1, inline=1, fontsize=10,color='k')

I worked before then I installed prettyplotlib and now I gives this test

I think prettyplotlib has changed the default font in python to a font that doesn't allow unicode character. How can I changed it back?

olgabot commented 10 years ago

Sorry about your issue. I'm not sure what could be causing it. Can you find out your python, matplotlib, and prettyplotlib versions? Python 3 is supposed to have better unicode support but I haven't fully made the switch.

I used this code and got similar errors:

import matplotlib.pyplot as plt
from matplotlib import cm

fig1=plt.figure()
ax1=fig1.gca()
im1=ax1.imshow(np.random.normal(100, size=(10,10)),cmap=cm.rainbow,extent=(0,90,-45,45),interpolation='bilinear')
ax1.set_xlabel(u'\u03b8 (°)')
ax1.set_ylabel(u'\u03c6 (°)')
cb1=fig1.colorbar(im1)
cb1.set_label(u'Amplitude de \u03b8 ij (°)')

image

Are these the same imports as you? Can you also do pip list to show all the packages you have installed?

pomxipum commented 10 years ago

Yes, I've the same imports. I use Python 2.7.3 pip list doesn't work for me but I've just install mplotlib and prettyplotlib for about 1 month so I think they're the newest versions.

olgabot commented 10 years ago

Thank you for your comment. Unfortunately, I no longer have the bandwidth to maintain prettyplotlib. I recommend using seaborn. Using seaborn, to get the prettyplotlib style, do:

import seaborn as sns
sns.set(style='ticks', palette='Set2')

And to remove "chartjunk", do:

sns.despine()

If you have discrete pull requests, I will accept them, but I personally will no longer fix bugs.

If you are a biological scientist looking for ways to analyze your big-ish (20+ samples) data, check out my main project, flotilla.