-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
plt.plot does not plot anything with named arguments #12106
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
Comments
I am not particularly sure that we want to support passing x and y as kwargs, see recent discussion on a similar topic at #11526. |
Thank you for your reply! Another suggestion would be a 'keyword-only' mode for the plot function (and other affected methods, today I stumbled upon the same issue with |
@taxus13 for an immediate work-around that's not writing your own function, seaborn might have you covered: |
fwiw I'm also against fully kw-only mode (also as discussed in the linked thread). |
I think that |
Well, errorbar doesn't have a completely |
I guess it is a bit weird that this just doesn't plot anything, rather than give some sort of error. |
I agree it should error out. |
If you are using a subplots, then you might want to consider the following - ''' The Figure in this case is 'fig' and
inside 'fig' is the subplot 'ax'. '''
fig, ax = plt.subplots(figsize=(12, 6))
# Plot the data
ax.plot([1, 2, 3], [1, 2, 3])
plt.show() I hope that helped! |
Actually a duplicate of #4059. |
Bug report
Bug summary
When using named arguments for x and y, the plots created with plt.plot respectively ax.plot are keeping empty. plt.errorbar (or ax.errorbar) are producing the desired output (see code below).
The documentation shows that x and y are valid named arguments.
Code for reproduction
Actual outcome

Expected outcome


or
Matplotlib version
print(matplotlib.get_backend())
): 'module://ipykernel.pylab.backend_inline'Python was installed using WinPython, packages installed with pip.
The text was updated successfully, but these errors were encountered: