Skip to content

DOC: try to use matplotlib style (mpl >= 1.4) in all docs #9706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions doc/source/10min.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
from pandas import options
import pandas as pd
np.set_printoptions(precision=4, suppress=True)
options.display.mpl_style='default'
import matplotlib
try:
matplotlib.style.use('ggplot')
except AttributeError:
options.display.mpl_style = 'default'
options.display.max_rows=15

#### portions of this were borrowed from the
Expand Down Expand Up @@ -695,8 +699,6 @@ Plotting

import matplotlib.pyplot as plt
plt.close('all')
from pandas import options
options.display.mpl_style='default'

.. ipython:: python

Expand Down
1 change: 0 additions & 1 deletion doc/source/categorical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from pandas import *
import pandas as pd
np.set_printoptions(precision=4, suppress=True)
options.display.mpl_style='default'
options.display.max_rows=15


Expand Down
6 changes: 5 additions & 1 deletion doc/source/computation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
import pandas.util.testing as tm
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
import matplotlib
try:
matplotlib.style.use('ggplot')
except AttributeError:
options.display.mpl_style = 'default'
import matplotlib.pyplot as plt
plt.close('all')
options.display.mpl_style='default'
options.display.max_rows=15

Computational tools
Expand Down
7 changes: 6 additions & 1 deletion doc/source/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
np.random.seed(123456)

pd.options.display.max_rows=15
pd.options.display.mpl_style='default'

import matplotlib
try:
matplotlib.style.use('ggplot')
except AttributeError:
pd.options.display.mpl_style = 'default'

np.set_printoptions(precision=4, suppress=True)

Expand Down
6 changes: 5 additions & 1 deletion doc/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ Frequently Asked Questions (FAQ)
from pandas.tseries.offsets import *
import matplotlib.pyplot as plt
plt.close('all')
options.display.mpl_style='default'
import matplotlib
try:
matplotlib.style.use('ggplot')
except AttributeError:
options.display.mpl_style = 'default'
from pandas.compat import lrange


Expand Down
8 changes: 6 additions & 2 deletions doc/source/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
np.set_printoptions(precision=4, suppress=True)
import matplotlib.pyplot as plt
plt.close('all')
options.display.mpl_style='default'
import matplotlib
try:
matplotlib.style.use('ggplot')
except AttributeError:
options.display.mpl_style = 'default'
from pandas.compat import zip

*****************************
Expand Down Expand Up @@ -346,7 +350,7 @@ A single group can be selected using ``GroupBy.get_group()``:
.. ipython:: python

grouped.get_group('bar')

Or for an object grouped on multiple columns:

.. ipython:: python
Expand Down
4 changes: 0 additions & 4 deletions doc/source/sparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import pandas.util.testing as tm
randn = np.random.randn
np.set_printoptions(precision=4, suppress=True)
import matplotlib.pyplot as plt
plt.close('all')
options.display.mpl_style='default'
options.display.max_rows = 15

**********************
Expand Down Expand Up @@ -222,4 +219,3 @@ row and columns coordinates of the matrix. Note that this will consume a signifi

ss_dense = SparseSeries.from_coo(A, dense_index=True)
ss_dense

10 changes: 7 additions & 3 deletions doc/source/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ We use the standard convention for referencing the matplotlib API:

import matplotlib.pyplot as plt

.. versionadded:: 0.11.0
The plots in this document are made using matplotlib's ``ggplot`` style (new in version 1.4):

The plots in this document are made using matplotlib's ``ggplot`` style (new in version 1.4).
If your version of matplotlib is 1.3 or lower, setting the ``display.mpl_style`` to ``'default'``
.. code-block:: python

import matplotlib
matplotlib.style.use('ggplot')

If your version of matplotlib is 1.3 or lower, you can set ``display.mpl_style`` to ``'default'``
with ``pd.options.display.mpl_style = 'default'``
to produce more appealing plots.
When set, matplotlib's ``rcParams`` are changed (globally!) to nicer-looking settings.
Expand Down