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

Skip to content

Commit 0309e38

Browse files
authored
Merge pull request #7033 from klaragerlei/matplotlib_plot_date_docs
DOC Updated plot_date to NumPy/SciPy style
2 parents 38be7ae + e0b8239 commit 0309e38

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
@@ -1414,12 +1414,7 @@ def plot(self, *args, **kwargs):
14141414
def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
14151415
**kwargs):
14161416
"""
1417-
Plot with data with dates.
1418-
1419-
Call signature::
1420-
1421-
plot_date(x, y, fmt='bo', tz=None, xdate=True,
1422-
ydate=False, **kwargs)
1417+
A plot with data that contains dates.
14231418
14241419
Similar to the :func:`~matplotlib.pyplot.plot` command, except
14251420
the *x* or *y* (or both) data is considered to be dates, and the
@@ -1428,45 +1423,53 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
14281423
*x* and/or *y* can be a sequence of dates represented as float
14291424
days since 0001-01-01 UTC.
14301425
1431-
Keyword arguments:
1426+
Note if you are using custom date tickers and formatters, it
1427+
may be necessary to set the formatters/locators after the call
1428+
to meth:`plot_date` since meth:`plot_date` will set the
1429+
default tick locator to
1430+
class:`matplotlib.dates.AutoDateLocator` (if the tick
1431+
locator is not already set to a
1432+
class:`matplotlib.dates.DateLocator` instance) and the
1433+
default tick formatter to
1434+
class:`matplotlib.dates.AutoDateFormatter` (if the tick
1435+
formatter is not already set to a
1436+
class:`matplotlib.dates.DateFormatter` instance).
1437+
14321438
1433-
*fmt*: string
1439+
Parameters
1440+
----------
1441+
fmt : string
14341442
The plot format string.
14351443
1436-
*tz*: [ *None* | timezone string | :class:`tzinfo` instance]
1444+
tz : [ *None* | timezone string | :class:`tzinfo` instance]
14371445
The time zone to use in labeling dates. If *None*, defaults to rc
14381446
value.
14391447
1440-
*xdate*: [ *True* | *False* ]
1448+
xdate : boolean
14411449
If *True*, the *x*-axis will be labeled with dates.
14421450
1443-
*ydate*: [ *False* | *True* ]
1451+
ydate : boolean
14441452
If *True*, the *y*-axis will be labeled with dates.
14451453
1446-
Note if you are using custom date tickers and formatters, it
1447-
may be necessary to set the formatters/locators after the call
1448-
to :meth:`plot_date` since :meth:`plot_date` will set the
1449-
default tick locator to
1450-
:class:`matplotlib.dates.AutoDateLocator` (if the tick
1451-
locator is not already set to a
1452-
:class:`matplotlib.dates.DateLocator` instance) and the
1453-
default tick formatter to
1454-
:class:`matplotlib.dates.AutoDateFormatter` (if the tick
1455-
formatter is not already set to a
1456-
:class:`matplotlib.dates.DateFormatter` instance).
14571454
1458-
Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
1455+
Returns
1456+
-------
1457+
lines
1458+
14591459
1460-
%(Line2D)s
1460+
See Also
1461+
--------
1462+
matplotlib.dates : helper functions on dates
1463+
matplotlib.dates.date2num : how to convert dates to num
1464+
matplotlib.dates.num2date : how to convert num to dates
1465+
matplotlib.dates.drange : how floating point dates
14611466
1462-
.. seealso::
14631467
1464-
:mod:`~matplotlib.dates` for helper functions
1468+
Other Parameters
1469+
----------------
1470+
kwargs : :class:`matplotlib.lines.Line2D`
1471+
properties : %(Line2D)s
14651472
1466-
:func:`~matplotlib.dates.date2num`,
1467-
:func:`~matplotlib.dates.num2date` and
1468-
:func:`~matplotlib.dates.drange` for help on creating the required
1469-
floating point dates.
14701473
"""
14711474

14721475
if not self._hold:

0 commit comments

Comments
 (0)