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

Skip to content

Commit 2ddc50e

Browse files
NelleVtacaswell
authored andcommitted
Merge pull request #7033 from klaragerlei/matplotlib_plot_date_docs
DOC Updated plot_date to NumPy/SciPy style
1 parent 55d7a4f commit 2ddc50e

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,12 +1412,7 @@ def plot(self, *args, **kwargs):
14121412
def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
14131413
**kwargs):
14141414
"""
1415-
Plot with data with dates.
1416-
1417-
Call signature::
1418-
1419-
plot_date(x, y, fmt='bo', tz=None, xdate=True,
1420-
ydate=False, **kwargs)
1415+
A plot with data that contains dates.
14211416
14221417
Similar to the :func:`~matplotlib.pyplot.plot` command, except
14231418
the *x* or *y* (or both) data is considered to be dates, and the
@@ -1426,45 +1421,53 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
14261421
*x* and/or *y* can be a sequence of dates represented as float
14271422
days since 0001-01-01 UTC.
14281423
1429-
Keyword arguments:
1424+
Note if you are using custom date tickers and formatters, it
1425+
may be necessary to set the formatters/locators after the call
1426+
to meth:`plot_date` since meth:`plot_date` will set the
1427+
default tick locator to
1428+
class:`matplotlib.dates.AutoDateLocator` (if the tick
1429+
locator is not already set to a
1430+
class:`matplotlib.dates.DateLocator` instance) and the
1431+
default tick formatter to
1432+
class:`matplotlib.dates.AutoDateFormatter` (if the tick
1433+
formatter is not already set to a
1434+
class:`matplotlib.dates.DateFormatter` instance).
1435+
14301436
1431-
*fmt*: string
1437+
Parameters
1438+
----------
1439+
fmt : string
14321440
The plot format string.
14331441
1434-
*tz*: [ *None* | timezone string | :class:`tzinfo` instance]
1442+
tz : [ *None* | timezone string | :class:`tzinfo` instance]
14351443
The time zone to use in labeling dates. If *None*, defaults to rc
14361444
value.
14371445
1438-
*xdate*: [ *True* | *False* ]
1446+
xdate : boolean
14391447
If *True*, the *x*-axis will be labeled with dates.
14401448
1441-
*ydate*: [ *False* | *True* ]
1449+
ydate : boolean
14421450
If *True*, the *y*-axis will be labeled with dates.
14431451
1444-
Note if you are using custom date tickers and formatters, it
1445-
may be necessary to set the formatters/locators after the call
1446-
to :meth:`plot_date` since :meth:`plot_date` will set the
1447-
default tick locator to
1448-
:class:`matplotlib.dates.AutoDateLocator` (if the tick
1449-
locator is not already set to a
1450-
:class:`matplotlib.dates.DateLocator` instance) and the
1451-
default tick formatter to
1452-
:class:`matplotlib.dates.AutoDateFormatter` (if the tick
1453-
formatter is not already set to a
1454-
:class:`matplotlib.dates.DateFormatter` instance).
14551452
1456-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
1453+
Returns
1454+
-------
1455+
lines
1456+
14571457
1458-
%(Line2D)s
1458+
See Also
1459+
--------
1460+
matplotlib.dates : helper functions on dates
1461+
matplotlib.dates.date2num : how to convert dates to num
1462+
matplotlib.dates.num2date : how to convert num to dates
1463+
matplotlib.dates.drange : how floating point dates
14591464
1460-
.. seealso::
14611465
1462-
:mod:`~matplotlib.dates` for helper functions
1466+
Other Parameters
1467+
----------------
1468+
kwargs : :class:`matplotlib.lines.Line2D`
1469+
properties : %(Line2D)s
14631470
1464-
:func:`~matplotlib.dates.date2num`,
1465-
:func:`~matplotlib.dates.num2date` and
1466-
:func:`~matplotlib.dates.drange` for help on creating the required
1467-
floating point dates.
14681471
"""
14691472

14701473
if not self._hold:

0 commit comments

Comments
 (0)