-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Marker kwarg in grid raise exception #25910
Comments
Did this ever work? What did it do, or do you expect it to do? |
For what its worth, i do find it unlikely that it would actually do what you expect. Here is what I get if I modify the grid to have markers (just by editing the last line in the traceback to have This seems unlikely to be desirable, I don't think? but it wouldn't be too hard to add handling for marker like we do for other kwargs there... it is also be possible to workaround it by setting the marker after enabling the grid for the first time, though that can still be fragile when continuing to manipulate the plot (i.e. it will still raise later on): plt.grid()
plt.grid(marker="o")
or
plt.gca().xaxis.grid(marker="o")
plt.gca().yaxis.grid(marker="o") It's not the most elegant, but it works. If, for instance, you were expecting a lattice of points at each intersection of the grid lines, that is not something that actually fits into the way |
Thanks, I just want to allow the user full control of the graphics settings, in the same way that you can set the line or its color. Thanks for the workaround. You are right, the marks do not make much sense in the grid, but I want to point out that in the documentation of grid, marker and its related kwargs should not be included, or if they do the result must be as you show, but no raise exception. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html |
I'm -1 on allowing marker for grid. That doesn't make sense. It should be an implementation detail that these lines are implemented using Correcting the list in https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html is not easily possible, because it is auto-generated from
|
Description
Using marker kwarg in grid raise a exception
Version used
python 3.11.2, really I found this bug same time ago using 3.9 or so
matplotlib 3.6.3
Although the error names Tkinter, the error is also reproduced with qt backend
Code to reproduce
And the exception raised...
The text was updated successfully, but these errors were encountered: