Matplotlib does not show the correct font on ubuntu 14.04

I installed matplotlib with all the dependencies on ubuntu 14.04 from the source

Processing dependencies for matplotlib==1.3.1
Searching for nose==1.3.3
Best match: nose 1.3.3
Processing nose-1.3.3-py2.7.egg
Removing nose 1.3.1 from easy-install.pth file
nose 1.3.3 is already the active version in easy-install.pth
Installing nosetests script to /usr/local/bin
Installing nosetests-2.7 script to /usr/local/bin
Using /usr/local/lib/python2.7/dist-packages/nose-1.3.3-py2.7.egg
Searching for pyparsing==2.0.1
Best match: pyparsing 2.0.1
Adding pyparsing 2.0.1 to easy-install.pth file
Using /usr/lib/python2.7/dist-packages
Searching for tornado==3.1.1
Best match: tornado 3.1.1
tornado 3.1.1 is already the active version in easy-install.pth
Using /usr/lib/python2.7/dist-packages
Searching for python-dateutil==1.5
Best match: python-dateutil 1.5
python-dateutil 1.5 is already the active version in easy-install.pth
Using /usr/lib/python2.7/dist-packages
Searching for numpy==1.8.1
Best match: numpy 1.8.1
numpy 1.8.1 is already the active version in easy-install.pth

When I try to build something, matplotlib does not show x ticks to the right, as you can see here http://bayanbox.ir/id/4106587232464013527?view

Source:

import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
import numpy as np
df=pd.DataFrame({'Val': np.random.random(50)})
df.index=pd.date_range('2000-01-02', periods=50)
plt.plot_date(df.index.to_pydatetime(), df.Val, fmt='-')
ax=plt.gca()
ax.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%y%b\n%d'))
plt.show()
+4
source share
1 answer

Matplotlib uses strftimeto work with date formatting in ticks. strftimewill use your locale on your computer to select the correct version of certain date formats, for example, January and Januar for English and German.

, - . Matplotlib , ( ).

, , locale Python locale .

+2

All Articles