Search code examples
pythonmatplotlibplotstylesheet

matplotlib layout like plotly by hand


I am plotting with matplotlib and trying to get a nice layout like plotly. Especially I would like to have a bar chart/box plot with filling and contour in the same colour. Not as default black/grey contour and coloured contour but like plotly. Any suggestions without stylesheet?

The following is solved:

Because by searching for the solution I found style sheets, but I get the following error message trying to load specific stylesheets in python matplotlib following the official manual:

>>> import matplotlib.pyplot as plt
>>> plt.style.use('ggplot')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'style'

same problem with:

>>> print plt.style.available
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'style'

Information about the system:

>>> matplotlib.__version__
'1.3.1'

So it seems that something is wrong with my installation, but what can I do? Any suggestions?


Solution

  • As shown in the release notes, the style package was added in matplotlib 1.4. You will need to upgrade if you want to use that.