Skip to content

Commit 3ece879

Browse files
author
TomAugspurger
committed
DOC: Try to use matplotlib ggplot style
1 parent 6d3803d commit 3ece879

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

doc/source/visualization.rst

+9-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
np.set_printoptions(precision=4, suppress=True)
1414
import matplotlib.pyplot as plt
1515
plt.close('all')
16-
options.display.mpl_style = 'default'
16+
import matplotlib
17+
try:
18+
matplotlib.style.use('ggplot')
19+
except AttributeError:
20+
options.display.mpl_style = 'default'
1721
options.display.max_rows = 15
1822
from pandas.compat import lrange
1923
@@ -29,14 +33,11 @@ We use the standard convention for referencing the matplotlib API:
2933
3034
.. versionadded:: 0.11.0
3135

32-
The ``display.mpl_style`` produces more appealing plots.
36+
The plots in this document are made using matplotlib's ``ggplot`` style (new in version 1.4).
37+
If your version of matplotlib is 1.3 or lower, setting the ``display.mpl_style`` to ``'default'``
38+
with ``pd.options.display.mpl_style = 'default'``
39+
to produce more appealing plots.
3340
When set, matplotlib's ``rcParams`` are changed (globally!) to nicer-looking settings.
34-
All the plots in the documentation are rendered with this option set to the
35-
'default' style.
36-
37-
.. ipython:: python
38-
39-
pd.options.display.mpl_style = 'default'
4041

4142
We provide the basics in pandas to easily create decent looking plots.
4243
See the :ref:`ecosystem <ecosystem.visualization>` section for visualization

0 commit comments

Comments
 (0)