Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cleanup code for format processing#19291

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 1 commit intomatplotlib:masterfromtimhoffm:cleanup-fmt-processing
Jan 18, 2021
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletionslib/matplotlib/axes/_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,9 +117,6 @@ def __call__(self, ax, renderer):
self._transform - ax.figure.transSubfigure)


_FORMAT_UNSET = 'None'


def _process_plot_format(fmt):
"""
Convert a MATLAB style color/line style format string to a (*linestyle*,
Expand All@@ -134,7 +131,7 @@ def _process_plot_format(fmt):

The format is absolute in the sense that if a linestyle or marker is not
defined in *fmt*, there is no line or marker. This is expressed by
returning_FORMAT_UNSET for the respective quantity.
returning'None' for the respective quantity.

See Also
--------
Expand DownExpand Up@@ -203,9 +200,9 @@ def _process_plot_format(fmt):
if linestyle is None and marker is None:
linestyle = mpl.rcParams['lines.linestyle']
if linestyle is None:
linestyle =_FORMAT_UNSET
linestyle ='None'
if marker is None:
marker =_FORMAT_UNSET
marker ='None'

return linestyle, marker, color

Expand DownExpand Up@@ -471,13 +468,17 @@ def _plot_args(self, tup, kwargs, return_kwargs=False):
# check for conflicts between fmt and kwargs
if (fmt.lower() != 'none'
and prop_name in kwargs
and val !=_FORMAT_UNSET):
and val !='None'):
# Technically ``plot(x, y, 'o', ls='--')`` is a conflict
# because 'o' implicitly unsets the linestyle
# (linestyle=_FORMAT_UNSET).
# (linestyle='None').
# We'll gracefully not warn in this case because an
# explicit set via kwargs can be seen as intention to
# override an implicit unset.
# Note: We don't val.lower() != 'none' because val is not
# necessarily a string (can be a tuple for colors). This
# is safe, because *val* comes from _process_plot_format()
# which only returns 'None'.
_api.warn_external(
f"{prop_name} is redundantly defined by the "
f"'{prop_name}' keyword argument and the fmt string "
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp