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

Appearance settings

Commit d8ceee6

Browse filesBrowse files
authored
Merge pull request #14399 from anntzer/datawarn
Improve warning for case where data kwarg entry is ambiguous.
2 parents 537535d + bfec0e7 commit d8ceee6
Copy full SHA for d8ceee6

File tree

Expand file treeCollapse file tree

1 file changed

+7
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-4
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,13 @@ def __call__(self, *args, **kwargs):
194194
else:
195195
if replaced[1] is not args[1]: # case 2a)
196196
cbook._warn_external(
197-
"Second argument {!r} is ambiguous: could be a "
198-
"color spec but is in data; using as data. "
199-
"Either rename the entry in data or use three "
200-
"arguments to plot.".format(args[1]),
197+
f"Second argument {args[1]!r} is ambiguous: could "
198+
f"be a format string but is in 'data'; using as "
199+
f"data. If it was intended as data, set the "
200+
f"format string to an empty string to suppress "
201+
f"this warning. If it was intended as a format "
202+
f"string, explicitly pass the x-values as well. "
203+
f"Alternatively, rename the entry in 'data'.",
201204
RuntimeWarning)
202205
label_namer_idx = 1
203206
else: # case 2b)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.