Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC Updated plot_date to NumPy/SciPy style #7033

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 6 commits into from
Sep 14, 2016
Merged
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
63 changes: 33 additions & 30 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1414,12 +1414,7 @@ def plot(self, *args, **kwargs):
def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
**kwargs):
"""
Plot with data with dates.

Call signature::

plot_date(x, y, fmt='bo', tz=None, xdate=True,
ydate=False, **kwargs)
A plot with data that contains dates.

Similar to the :func:`~matplotlib.pyplot.plot` command, except
the *x* or *y* (or both) data is considered to be dates, and the
Expand All @@ -1428,45 +1423,53 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
*x* and/or *y* can be a sequence of dates represented as float
days since 0001-01-01 UTC.

Keyword arguments:
Note if you are using custom date tickers and formatters, it
may be necessary to set the formatters/locators after the call
to meth:`plot_date` since meth:`plot_date` will set the
default tick locator to
class:`matplotlib.dates.AutoDateLocator` (if the tick
locator is not already set to a
class:`matplotlib.dates.DateLocator` instance) and the
default tick formatter to
class:`matplotlib.dates.AutoDateFormatter` (if the tick
formatter is not already set to a
class:`matplotlib.dates.DateFormatter` instance).


*fmt*: string
Parameters
----------
fmt : string
The plot format string.

*tz*: [ *None* | timezone string | :class:`tzinfo` instance]
tz : [ *None* | timezone string | :class:`tzinfo` instance]
The time zone to use in labeling dates. If *None*, defaults to rc
value.

*xdate*: [ *True* | *False* ]
xdate : boolean
If *True*, the *x*-axis will be labeled with dates.

*ydate*: [ *False* | *True* ]
ydate : boolean
If *True*, the *y*-axis will be labeled with dates.

Note if you are using custom date tickers and formatters, it
may be necessary to set the formatters/locators after the call
to :meth:`plot_date` since :meth:`plot_date` will set the
default tick locator to
:class:`matplotlib.dates.AutoDateLocator` (if the tick
locator is not already set to a
:class:`matplotlib.dates.DateLocator` instance) and the
default tick formatter to
:class:`matplotlib.dates.AutoDateFormatter` (if the tick
formatter is not already set to a
:class:`matplotlib.dates.DateFormatter` instance).

Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
Returns
-------
lines


%(Line2D)s
See Also
--------
matplotlib.dates : helper functions on dates
matplotlib.dates.date2num : how to convert dates to num
matplotlib.dates.num2date : how to convert num to dates
matplotlib.dates.drange : how floating point dates

.. seealso::

:mod:`~matplotlib.dates` for helper functions
Other Parameters
----------------
kwargs : :class:`matplotlib.lines.Line2D`
properties : %(Line2D)s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line2D gets expanded into several parameter listings; it should be on its own line. (And likely needs to be updated to match this formatting.)


:func:`~matplotlib.dates.date2num`,
:func:`~matplotlib.dates.num2date` and
:func:`~matplotlib.dates.drange` for help on creating the required
floating point dates.
"""

if not self._hold:
Expand Down