matplotlib.pyplot.
plot_date
(x, y, fmt='o', tz=None, xdate=True, ydate=False, *, data=None, **kwargs)[source]¶Plot data that contains dates.
Similar to plot
, this plots y vs. x as lines or markers.
However, the axis labels are formatted as dates depending on xdate
and ydate.
Parameters: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Other Parameters: |
|
See also
matplotlib.dates
matplotlib.dates.date2num
matplotlib.dates.num2date
matplotlib.dates.drange
Notes
If you are using custom date tickers and formatters, it may be
necessary to set the formatters/locators after the call to
plot_date
. plot_date
will set the default tick locator to
AutoDateLocator
(if the tick locator is not already set to a
DateLocator
instance) and the default tick formatter to
AutoDateFormatter
(if the tick formatter is not already set to a
DateFormatter
instance).
Note
In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[<arg>]:
Objects passed as data must support item access (data[<arg>]
) and
membership test (<arg> in data
).
matplotlib.pyplot.plot_date
¶