| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Would it make sense for the negative planes to swap left/right edges? So that the lines always go through 0.0? |
Sorry, something went wrong.
|
I had thought about that and thought it might be less useful when the axes are shifted away from 0, but am open to that too. Either is an improvement over the current. |
Sorry, something went wrong.
Tests Fix broken tests Clean up test
|
@QuLogic trying it out, I like the layout of your suggestion just as much and it probably makes more intuitive sense. Simplifies the logic too. I replaced the image in the top post so you can look at it |
Sorry, something went wrong.
|
Just for fun, here's an "unfolded" view of a 3D plot that might be useful to people/worth sticking in docs. import matplotlib.pyplot as plt
def annotate_axes(ax, text, fontsize=18):
ax.text(x=0.5, y=0.5, z=0.5, s=text,
va="center", ha="center", fontsize=fontsize, color="black")
# (view, (elev, azim, roll))
views = [( 'XY', ( 90, -90, 0)),
( 'XZ', ( 0, -90, 0)),
( 'YZ', ( 0, 0, 0)),
('-XY', (-90, 90, 0)),
('-XZ', ( 0, 90, 0)),
('-YZ', ( 0, 180, 0))]
layout = [['XY', '.', 'L', '.'],
['XZ','YZ','-XZ','-YZ',],
['.', '.','-XY', '.',]]
fig, axd = plt.subplot_mosaic(layout, subplot_kw={'projection': '3d'})
for i in range(len(axd) - 1):
plane = views[i][0]
axd[plane].set_xlabel('x')
axd[plane].set_ylabel('y')
axd[plane].set_zlabel('z')
axd[plane].set_proj_type('ortho')
axd[plane].view_init(elev=views[i][1][0], azim=views[i][1][1], roll=views[i][1][2])
label = f'{plane}\n{views[i][1]}'
annotate_axes(axd[plane], label, fontsize=14)
label = 'matplotlib Axes3D Primary View Planes\nax.view_init(elev, azim, roll)'
annotate_axes(axd['L'], label, fontsize=18)
axd['L'].set_axis_off()
plt.tight_layout() |
Sorry, something went wrong.
|
OK, sorry one more question; can the third Axis also always appear around 0/0? |
Sorry, something went wrong.
|
Unfortunately not, to do so would require having the backing planes in the +-XY and +-YZ views blocking either the plot volume or the axis spines. Here are the plots with the same axis locations rotated slightly off-angle to help visualize this. I mean, I supposed you could carve out blocking views for specifically these angles, but then it's a discontinuous flash when rotating the plots manually or programmatically. And I think it'd be pretty ugly to implement. |
Sorry, something went wrong.
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
matplotlib#23644) * Put edge-on axes on left and right when viewing 3d axis planes Tests Fix broken tests Clean up test Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
matplotlib#23644) * Put edge-on axes on left and right when viewing 3d axis planes Tests Fix broken tests Clean up test Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
| Back | FazBrowse Home | New Git URL |
PR Summary
For the special cases of looking at the 3d axes in the 6 primary view planes (defined in the docs in #23600), draw the axes such that one is on the bottom edge and the other intersects at the low value (ie the intersection is at the origin for these examples). This blends smoothly when rotating the axes manually, since we are only looking at the epsilon case.
Code to generate these plots is the same as here.
Before:

After:

PR Checklist
Tests and Styling
Documentation