Feature Request: 3D Axes Positioning to Origin

Hi Devs, I’ve been searching the web and in forums looking for a proper way to “move” the axes such that they originate from, well, the origin.

I just want a option like
ax = fig.add_subplot(111, projection=‘3d’, axes=‘centered’, axesarrows='‘on’)
To create a 3D axis with axes arrows pointing from the origin.

There was a similar stack question from 6 years ago, where they mentioned there isn’t really a supported method to do this. However, I think this is pretty basic and should be included as native functionality. Please let me know if there is something like this now and I’ve just missed it.

I’ve looked on google, I’ve looked on these discouse threads, but haven’t found anything satisfactory. I find myself struggling because of having to mess with the tick marks, and scaling them, and adding quiver arrows, which can get close, but it’s a horrible experience. If the objects change, then the ticks need to be adjusted, the arrows don’t fit right. I’m sure you’re aware it’s a very “fiddely” experience - and keep in mind that not all users are at your level of capability. Many just want it simple and foolproof.

This image is from some python I wrote, with around 140 lines of just plot-related code (to deal with decimal places, dynamic-updating tick marks, arrows, X,Y,Z text boxes for the arrows. The stack overflow example had the tick marks along the edges, which can be good, but I want to move those to the axis as well as an option.

Even better if there’s a way to arbitrarily place the axes (with tick marks) to a specific place, such as
ax.xaxis.move2yz(5.5, 10.8)
ax.yaxis.move2xz(0.0, 3.3)
ax.zaxis.move2xy(1.77, 6.8)
(yes I know it’s weird, but at least it’s less work than having to create your own new tick mark system)

Thank you for your time!
(edited to provide a clearer example of what I’m looking for)

Hey, sorry just saw this - you may want to open an issue on github for this. @scottshambaugh?

Hey @plothead, unfortunately your research is correct, there isn’t currently a way to do this in matplotlib, and I think it’ll be a decently sized effort to enable the functionality. But it is a good idea, and I’ve opened up a feature request here: [ENH]: Arbitrary placement of 3D axes & panes · Issue #29586 · matplotlib/matplotlib · GitHub

2 Likes