-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
More doc fixes #3521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More doc fixes #3521
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -520,22 +520,23 @@ class AutoDateFormatter(ticker.Formatter): | |
>>> formatter = AutoDateFormatter() | ||
>>> formatter.scaled[1/(24.*60.)] = '%M:%S' # only show min and sec | ||
|
||
Custom `FunctionFormatter`s can also be used. The following example shows | ||
how to use a custom format function to strip trailing zeros from decimal | ||
seconds and adds the date to the first ticklabel:: | ||
|
||
>>> def my_format_function(x, pos=None): | ||
... x = matplotlib.dates.num2date(x) | ||
... if pos == 0: | ||
... fmt = '%D %H:%M:%S.%f' | ||
... else: | ||
... fmt = '%H:%M:%S.%f' | ||
... label = x.strftime(fmt) | ||
... label = label.rstrip("0") | ||
... label = label.rstrip(".") | ||
... return label | ||
>>> from matplotlib.ticker import FuncFormatter | ||
>>> formatter.scaled[1/(24.*60.)] = FuncFormatter(my_format_function) | ||
A custom :class:`~matplotlib.ticker.FuncFormatter` can also be used. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The end ` should be followed by a blank space. Solve this by rewriting. Also make this a link to the relevant class |
||
The following example shows how to use a custom format function to strip | ||
trailing zeros from decimal seconds and adds the date to the first | ||
ticklabel:: | ||
|
||
>>> def my_format_function(x, pos=None): | ||
... x = matplotlib.dates.num2date(x) | ||
... if pos == 0: | ||
... fmt = '%D %H:%M:%S.%f' | ||
... else: | ||
... fmt = '%H:%M:%S.%f' | ||
... label = x.strftime(fmt) | ||
... label = label.rstrip("0") | ||
... label = label.rstrip(".") | ||
... return label | ||
>>> from matplotlib.ticker import FuncFormatter | ||
>>> formatter.scaled[1/(24.*60.)] = FuncFormatter(my_format_function) | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to be indented to render properly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably or properly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. properly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See this for the wrong rendering http://matplotlib.org/api/dates_api.html#matplotlib.dates.AutoDateFormatter |
||
|
||
# This can be improved by providing some user-level direction on | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is being interpreted as a link to no where.