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

Skip to content

Commit 0704479

Browse files
klaragerleiNelleV
authored andcommitted
DOC Updated plot_date documentation to NumPy/SciPy style
1 parent e92dc56 commit 0704479

File tree

1 file changed

+39
-32
lines changed

1 file changed

+39
-32
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,59 +1414,66 @@ 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.
1417+
A plot with data that contains dates.
14181418
1419-
Call signature::
1420-
1421-
plot_date(x, y, fmt='bo', tz=None, xdate=True,
1422-
ydate=False, **kwargs)
1423-
1424-
Similar to the :func:`~matplotlib.pyplot.plot` command, except
1419+
Similar to the func : matplotlib.pyplot.plot command, except
14251420
the *x* or *y* (or both) data is considered to be dates, and the
14261421
axis is labeled accordingly.
14271422
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
1434-
The plot format string.
1439+
Parameters
1440+
----------
1441+
fmt : string
1442+
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
14591458
1460-
%(Line2D)s
14611459
1462-
.. seealso::
1460+
See Also
1461+
--------
1462+
mod : matplotlib.dates for helper functions
1463+
func : matplotlib.dates.date2num
1464+
func : matplotlib.dates.num2date
1465+
func : matplotlib.dates.drange for help on creating the required floating point dates
1466+
1467+
1468+
Other Parameters
1469+
----------------
1470+
kwargs : class : matplotlib.lines.Line2D properties : %(Line2D)s
1471+
14631472
1464-
:mod:`~matplotlib.dates` for helper functions
1473+
Examples
1474+
--------
1475+
.. plot:: mpl_examples/pylab_examples/date_demo1.py
14651476
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.
14701477
"""
14711478

14721479
if not self._hold:

0 commit comments

Comments
 (0)