diff --git a/doc/source/10min.rst b/doc/source/10min.rst index ef6b2d6ef2c90..0a23f490e6628 100644 --- a/doc/source/10min.rst +++ b/doc/source/10min.rst @@ -11,7 +11,7 @@ np.random.seed(123456) np.set_printoptions(precision=4, suppress=True) import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') pd.options.display.max_rows = 15 #### portions of this were borrowed from the diff --git a/doc/source/computation.rst b/doc/source/computation.rst index 23699393958cf..97472ca4dd938 100644 --- a/doc/source/computation.rst +++ b/doc/source/computation.rst @@ -8,7 +8,7 @@ np.set_printoptions(precision=4, suppress=True) import pandas as pd import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') import matplotlib.pyplot as plt plt.close('all') pd.options.display.max_rows=15 diff --git a/doc/source/cookbook.rst b/doc/source/cookbook.rst index 5bb3ba75fe51b..f13e5e67de07e 100644 --- a/doc/source/cookbook.rst +++ b/doc/source/cookbook.rst @@ -20,7 +20,7 @@ pd.options.display.max_rows=15 import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') np.set_printoptions(precision=4, suppress=True) diff --git a/doc/source/dsintro.rst b/doc/source/dsintro.rst index ec0a1c7a00bf7..e5c7637ddb499 100644 --- a/doc/source/dsintro.rst +++ b/doc/source/dsintro.rst @@ -10,7 +10,7 @@ pd.options.display.max_rows = 15 import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') import matplotlib.pyplot as plt plt.close('all') diff --git a/doc/source/gotchas.rst b/doc/source/gotchas.rst index 9e6f98923fca6..8ae830d7fd76b 100644 --- a/doc/source/gotchas.rst +++ b/doc/source/gotchas.rst @@ -14,7 +14,7 @@ Frequently Asked Questions (FAQ) import pandas as pd pd.options.display.max_rows = 15 import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') import matplotlib.pyplot as plt plt.close('all') diff --git a/doc/source/groupby.rst b/doc/source/groupby.rst index e1231b9a4a200..ddc7d7fcd2ff1 100644 --- a/doc/source/groupby.rst +++ b/doc/source/groupby.rst @@ -10,7 +10,7 @@ import pandas as pd pd.options.display.max_rows = 15 import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') import matplotlib.pyplot as plt plt.close('all') from collections import OrderedDict diff --git a/doc/source/missing_data.rst b/doc/source/missing_data.rst index 65b411ccd4af2..1fffb2963b7ca 100644 --- a/doc/source/missing_data.rst +++ b/doc/source/missing_data.rst @@ -7,7 +7,7 @@ import pandas as pd pd.options.display.max_rows=15 import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') import matplotlib.pyplot as plt .. _missing_data: diff --git a/doc/source/visualization.rst b/doc/source/visualization.rst index b5a261e3acac5..bed83758ee2ff 100644 --- a/doc/source/visualization.rst +++ b/doc/source/visualization.rst @@ -10,7 +10,7 @@ np.set_printoptions(precision=4, suppress=True) pd.options.display.max_rows = 15 import matplotlib - matplotlib.style.use('ggplot') + # matplotlib.style.use('default') import matplotlib.pyplot as plt plt.close('all') @@ -24,13 +24,6 @@ We use the standard convention for referencing the matplotlib API: import matplotlib.pyplot as plt -The plots in this document are made using matplotlib's ``ggplot`` style (new in version 1.4): - -.. code-block:: python - - import matplotlib - matplotlib.style.use('ggplot') - We provide the basics in pandas to easily create decent looking plots. See the :ref:`ecosystem ` section for visualization libraries that go beyond the basics documented here. @@ -134,7 +127,7 @@ For example, a bar plot can be created the following way: plt.figure(); @savefig bar_plot_ex.png - df.iloc[5].plot(kind='bar'); plt.axhline(0, color='k') + df.iloc[5].plot(kind='bar'); .. versionadded:: 0.17.0 @@ -154,7 +147,7 @@ and :ref:`DataFrame.boxplot() ` methods, which use a separate Finally, there are several :ref:`plotting functions ` in ``pandas.plotting`` that take a :class:`Series` or :class:`DataFrame` as an argument. These -include +include: * :ref:`Scatter Matrix ` * :ref:`Andrews Curves ` @@ -1049,6 +1042,21 @@ be colored differently. Plot Formatting --------------- +Setting the plot style +~~~~~~~~~~~~~~~~~~~~~~ + +From version 1.5 and up, matplotlib offers a range of preconfigured plotting styles. Setting the +style can be used to easily give plots the general look that you want. +Setting the style is as easy as calling ``matplotlib.style.use(my_plot_style)`` before +creating your plot. For example you could do ``matplotlib.style.use('ggplot')`` for ggplot-style +plots. + +You can see the various available style names at ``matplotlib.style.available`` and it's very +easy to try them out. + +General plot style arguments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Most plotting methods have a set of keyword arguments that control the layout and formatting of the returned plot: