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

Skip to content

Commit 592ac13

Browse files
committed
Merge pull request #3521 from jenshnielsen/more_doc_fixes
DOC : More doc fixes
2 parents e70c567 + 630f867 commit 592ac13

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,12 +1014,12 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
10141014
10151015
Keyword arguments may include the following (with defaults):
10161016
1017-
location : [`None`|'left'|'right'|'top'|'bottom']
1017+
location : [None|'left'|'right'|'top'|'bottom']
10181018
The position, relative to **parents**, where the colorbar axes
10191019
should be created. If None, the value will either come from the
10201020
given ``orientation``, else it will default to 'right'.
10211021
1022-
orientation : [`None`|'vertical'|'horizontal']
1022+
orientation : [None|'vertical'|'horizontal']
10231023
The orientation of the colorbar. Typically, this keyword shouldn't
10241024
be used, as it can be derived from the ``location`` keyword.
10251025

lib/matplotlib/dates.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -520,22 +520,23 @@ class AutoDateFormatter(ticker.Formatter):
520520
>>> formatter = AutoDateFormatter()
521521
>>> formatter.scaled[1/(24.*60.)] = '%M:%S' # only show min and sec
522522
523-
Custom `FunctionFormatter`s can also be used. The following example shows
524-
how to use a custom format function to strip trailing zeros from decimal
525-
seconds and adds the date to the first ticklabel::
526-
527-
>>> def my_format_function(x, pos=None):
528-
... x = matplotlib.dates.num2date(x)
529-
... if pos == 0:
530-
... fmt = '%D %H:%M:%S.%f'
531-
... else:
532-
... fmt = '%H:%M:%S.%f'
533-
... label = x.strftime(fmt)
534-
... label = label.rstrip("0")
535-
... label = label.rstrip(".")
536-
... return label
537-
>>> from matplotlib.ticker import FuncFormatter
538-
>>> formatter.scaled[1/(24.*60.)] = FuncFormatter(my_format_function)
523+
A custom :class:`~matplotlib.ticker.FuncFormatter` can also be used.
524+
The following example shows how to use a custom format function to strip
525+
trailing zeros from decimal seconds and adds the date to the first
526+
ticklabel::
527+
528+
>>> def my_format_function(x, pos=None):
529+
... x = matplotlib.dates.num2date(x)
530+
... if pos == 0:
531+
... fmt = '%D %H:%M:%S.%f'
532+
... else:
533+
... fmt = '%H:%M:%S.%f'
534+
... label = x.strftime(fmt)
535+
... label = label.rstrip("0")
536+
... label = label.rstrip(".")
537+
... return label
538+
>>> from matplotlib.ticker import FuncFormatter
539+
>>> formatter.scaled[1/(24.*60.)] = FuncFormatter(my_format_function)
539540
"""
540541

541542
# This can be improved by providing some user-level direction on

0 commit comments

Comments
 (0)