-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
"Classical" zero-axis plot with arrows and symmetric ticks seems to be impossible #17157
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
This would more appropriately be discussed at http://discourse.matplotlib.org or stackoverflow. |
Indeed,
(Obviously that uses internal private attributes and is hence not an option for being documented.) The other example comes from https://matplotlib.org/3.2.1/gallery/ticks_and_spines/spine_placement_demo.html and is hence part of core core matplotlib. It uses normal axes and those do not support arrows at the tips.
I guess adding this (or any similar solution) to the docs would be a win. Because many people actually want such direction arrows on axes. |
Thank you very much for the detailed reply. This solution works great for all practical purposes. Indeed, it might be nice to add it to the gallery or otherwise to the documentation. Ideally, it would make sense to develop a style sheet for this purpose. The available styles are very nice, but all seem targeted toward presenting data, not toward technical sketches, where the plot is usually reduced to the bare-bone qualitative features. |
Bug report
Bug summary
I am trying to use matplotlib to produce classical "Mathematics-style" plots in production quality, with a cross of coordinate axes through the origin, arrow tips on the axes, and symmetic ("inout") ticks (in fact, since the entire plot is symmetric, there is no in or out, so asymmetric tick placement looks out of place).
Following axisartist-demo-axisline-style from the Matplotlib gallery, I am able to get the arrows, but it fails on the symmetric ticks. Using an alternative incantation which a student of mine came up with (I don't know where from), the symmetric ticks work, but we don't seem to be able to get arrow heads on the axes.
Both examples also differ in other placement decisions (why???), none is optimal, but all other things look fixable with some effort.
I am not sure whether this is a documentation bug or a code bug, but what bugs me is the apparent impossibility to meet the two requirements, arrow heads and symmetric ticks, at once.
Code for reproduction
Actual outcome


Expected outcome
The first plot should just produce symmetric ticks, as requested in the rcParams. For the second one, it might be missing documentation, I just don't know how to proceed. The differences between the two versions are very strange, and not documented in any obvious place.
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggDefault Fedora 30 install.
The text was updated successfully, but these errors were encountered: