<commit_before>.. currentmodule:: pandas
.. _visualization:

.. ipython:: python
   :suppress:

   import numpy as np
   import pandas as pd
   from numpy.random import randn, rand, randint
   np.random.seed(123456)
   from pandas import DataFrame, Series, date_range, options
   import pandas.util.testing as tm
   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
   from pandas.compat import lrange

********
Plotting
********

We use the standard convention for referencing the matplotlib API:

.. ipython:: python

   import matplotlib.pyplot as plt

.. versionadded:: 0.11.0

The ``display.mpl_style`` produces more appealing plots.
When set, matplotlib's ``rcParams`` are changed (globally!) to nicer-looking settings.
All the plots in the documentation are rendered with this option set to the
'default' style.

.. ipython:: python

   pd.options.display.mpl_style = 'default'

We provide the basics in pandas to easily create decent looking plots.
See the :ref:`ecosystem <ecosystem.visualization>` section for visualization
libraries that go beyond the basics documented here.
<commit_msg>DOC: Try to use matplotlib ggplot style<commit_after>.. currentmodule:: pandas
.. _visualization:

.. ipython:: python
   :suppress:

   import numpy as np
   import pandas as pd
   from numpy.random import randn, rand, randint
   np.random.seed(123456)
   from pandas import DataFrame, Series, date_range, options
   import pandas.util.testing as tm
   np.set_printoptions(precision=4, suppress=True)
   import matplotlib.pyplot as plt
   plt.close('all')
   import matplotlib
   try:
      matplotlib.style.use('ggplot')
   except AttributeError:
      options.display.mpl_style = 'default'
   options.display.max_rows = 15
   from pandas.compat import lrange

********
Plotting
********

We use the standard convention for referencing the matplotlib API:

.. ipython:: python

   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).
If your version of matplotlib is 1.3 or lower, setting the ``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.

We provide the basics in pandas to easily create decent looking plots.
See the :ref:`ecosystem <ecosystem.visualization>` section for visualization
libraries that go beyond the basics documented here.

{'fraction_non_alphanumeric': 0.09688449848024316, 'fraction_numerical': 0.011398176291793313, 'mean_word_length': 4.183070866141732, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3193234', 'n_tokens_mistral': 828, 'n_tokens_neox': 763, 'n_words': 283}