It seems as though there are various problems rendering unicode, especially to pdf files.
I see the same problem that you do using a slightly different matplotlib version (see below).
It doesn't happen if I switch to a different matplotlib backend, or alternatively, if you have latex installed, you can let latex do the text rendering (see http://matplotlib.org/users/usetex.html). On Ubuntu I believe you need the texlive-latex-extra
package installed if you don't have it already.
Latex:
The latex method works the best, but it is much slower and of course introduces a large external dependency. I added the following three lines to the top of your file:
import matplotlib
matplotlib.rcParams['text.usetex']=True
matplotlib.rcParams['text.latex.unicode']=True
See the result below -- looks pretty good but you'd probably want to do something about the axis tick labels.
Cairo
Alternatively, you can use the the GTKCairo backend. I added two lines to the top of your code:
import matplotlib
matplotlib.use("GTKCairo")
You can see in the image below that it isn't perfect -- the legend text is aligned properly, but unfortunately it now strays outside the legend box. I don't really know why that happens but a possible workaround is to change the line plt.legend()
to plt.legend(borderpad=2)
, which gives the final image below. There's now too much whitespace but at least the text fits. You might be able to try different legend options to get something that looks better.
The images
Note that they seem to look much worse here than in the original pdf files. I just uploaded the pdf files directly to imgur which seems to convert them to fairly low resolution images.
Originally:
With latex:
A close-up screenshot of the latex pdf:
With GTKCairo backend:
With GTKCairo and borderpad=2