Skip to content

DOC: Fix visualization.rst flake8 issues #24186

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 3 commits into from
Dec 10, 2018
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
55 changes: 28 additions & 27 deletions doc/source/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ libraries that go beyond the basics documented here.
Basic Plotting: ``plot``
------------------------

We will demonstrate the basics, see the :ref:`cookbook<cookbook.plotting>` for
We will demonstrate the basics, see the :ref:`cookbook<cookbook.plotting>` for
some advanced strategies.

The ``plot`` method on Series and DataFrame is just a simple wrapper around
Expand Down Expand Up @@ -87,7 +87,7 @@ You can plot one column versus another using the `x` and `y` keywords in

.. note::

For more formatting and styling options, see
For more formatting and styling options, see
:ref:`formatting <visualization.formatting>` below.

.. ipython:: python
Expand Down Expand Up @@ -129,7 +129,7 @@ You can also create these other plots using the methods ``DataFrame.plot.<kind>`

In [14]: df = pd.DataFrame()

In [15]: df.plot.<TAB>
In [15]: df.plot.<TAB> # noqa: E225, E999
df.plot.area df.plot.barh df.plot.density df.plot.hist df.plot.line df.plot.scatter
df.plot.bar df.plot.box df.plot.hexbin df.plot.kde df.plot.pie

Expand Down Expand Up @@ -163,7 +163,8 @@ For labeled, non-time series data, you may wish to produce a bar plot:
plt.figure();

@savefig bar_plot_ex.png
df.iloc[5].plot.bar(); plt.axhline(0, color='k')
df.iloc[5].plot.bar()
plt.axhline(0, color='k');

Calling a DataFrame's :meth:`plot.bar() <DataFrame.plot.bar>` method produces a multiple
bar plot:
Expand Down Expand Up @@ -231,7 +232,7 @@ Histograms can be drawn by using the :meth:`DataFrame.plot.hist` and :meth:`Seri

plt.close('all')

A histogram can be stacked using ``stacked=True``. Bin size can be changed
A histogram can be stacked using ``stacked=True``. Bin size can be changed
using the ``bins`` keyword.

.. ipython:: python
Expand All @@ -246,8 +247,8 @@ using the ``bins`` keyword.

plt.close('all')

You can pass other keywords supported by matplotlib ``hist``. For example,
horizontal and cumulative histograms can be drawn by
You can pass other keywords supported by matplotlib ``hist``. For example,
horizontal and cumulative histograms can be drawn by
``orientation='horizontal'`` and ``cumulative=True``.

.. ipython:: python
Expand Down Expand Up @@ -477,7 +478,7 @@ keyword, will affect the output type as well:

plt.close('all')

The subplots above are split by the numeric columns first, then the value of
The subplots above are split by the numeric columns first, then the value of
the ``g`` column. Below the subplots are first split by the value of ``g``,
then by the numeric columns.

Expand Down Expand Up @@ -579,8 +580,8 @@ each point:

plt.close('all')

You can pass other keywords supported by matplotlib
:meth:`scatter <matplotlib.axes.Axes.scatter>`. The example below shows a
You can pass other keywords supported by matplotlib
:meth:`scatter <matplotlib.axes.Axes.scatter>`. The example below shows a
bubble chart using a column of the ``DataFrame`` as the bubble size.

.. ipython:: python
Expand Down Expand Up @@ -684,15 +685,15 @@ A ``ValueError`` will be raised if there are any negative values in your data.

plt.close('all')

For pie plots it's best to use square figures, i.e. a figure aspect ratio 1.
You can create the figure with equal width and height, or force the aspect ratio
to be equal after plotting by calling ``ax.set_aspect('equal')`` on the returned
For pie plots it's best to use square figures, i.e. a figure aspect ratio 1.
You can create the figure with equal width and height, or force the aspect ratio
to be equal after plotting by calling ``ax.set_aspect('equal')`` on the returned
``axes`` object.

Note that pie plot with :class:`DataFrame` requires that you either specify a
target column by the ``y`` argument or ``subplots=True``. When ``y`` is
specified, pie plot of selected column will be drawn. If ``subplots=True`` is
specified, pie plots for each column are drawn as subplots. A legend will be
Note that pie plot with :class:`DataFrame` requires that you either specify a
target column by the ``y`` argument or ``subplots=True``. When ``y`` is
specified, pie plot of selected column will be drawn. If ``subplots=True`` is
specified, pie plots for each column are drawn as subplots. A legend will be
drawn in each pie plots by default; specify ``legend=False`` to hide it.

.. ipython:: python
Expand Down Expand Up @@ -918,7 +919,7 @@ Lag Plot
Lag plots are used to check if a data set or time series is random. Random
data should not exhibit any structure in the lag plot. Non-random structure
implies that the underlying data are not random. The ``lag`` argument may
be passed, and when ``lag=1`` the plot is essentially ``data[:-1]`` vs.
be passed, and when ``lag=1`` the plot is essentially ``data[:-1]`` vs.
``data[1:]``.

.. ipython:: python
Expand Down Expand Up @@ -954,7 +955,7 @@ If time series is random, such autocorrelations should be near zero for any and
all time-lag separations. If time series is non-random then one or more of the
autocorrelations will be significantly non-zero. The horizontal lines displayed
in the plot correspond to 95% and 99% confidence bands. The dashed line is 99%
confidence band. See the
confidence band. See the
`Wikipedia entry <https://en.wikipedia.org/wiki/Correlogram>`__ for more about
autocorrelation plots.

Expand Down Expand Up @@ -1446,9 +1447,9 @@ Plotting with matplotlib table is now supported in :meth:`DataFrame.plot` and :

plt.close('all')

Also, you can pass a different :class:`DataFrame` or :class:`Series` to the
``table`` keyword. The data will be drawn as displayed in print method
(not transposed automatically). If required, it should be transposed manually
Also, you can pass a different :class:`DataFrame` or :class:`Series` to the
``table`` keyword. The data will be drawn as displayed in print method
(not transposed automatically). If required, it should be transposed manually
as seen in the example below.

.. ipython:: python
Expand All @@ -1463,9 +1464,9 @@ as seen in the example below.

plt.close('all')

There also exists a helper function ``pandas.plotting.table``, which creates a
table from :class:`DataFrame` or :class:`Series`, and adds it to an
``matplotlib.Axes`` instance. This function can accept keywords which the
There also exists a helper function ``pandas.plotting.table``, which creates a
table from :class:`DataFrame` or :class:`Series`, and adds it to an
``matplotlib.Axes`` instance. This function can accept keywords which the
matplotlib `table <http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.table>`__ has.

.. ipython:: python
Expand Down Expand Up @@ -1597,8 +1598,8 @@ Plotting directly with matplotlib

In some situations it may still be preferable or necessary to prepare plots
directly with matplotlib, for instance when a certain type of plot or
customization is not (yet) supported by pandas. ``Series`` and ``DataFrame``
objects behave like arrays and can therefore be passed directly to
customization is not (yet) supported by pandas. ``Series`` and ``DataFrame``
objects behave like arrays and can therefore be passed directly to
matplotlib functions without explicit casts.

pandas also automatically registers formatters and locators that recognize date
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ exclude =
doc/source/options.rst
doc/source/release.rst
doc/source/reshaping.rst
doc/source/visualization.rst


[yapf]
Expand Down