-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
3d plot view angle documentation #23721
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
Conversation
15958bc
to
eb13a69
Compare
9a27673
to
16a5e9c
Compare
16a5e9c
to
40d1844
Compare
I think that it is possible to store an svg-file and use that? (There's been a similar case in SymPy reducing the file size from MBs to kb... I do not know if any specific settings are required. But most browsers can render svg anyway?) But the image looks good! |
PNG size can be reduced by factors if put through a compressor like https://tinypng.com/. I think if applied to both images, sizes are reasonable small. The real advantage of SVG would be that we could adapt it later on, but I'm ok with PNG if that's what you can generate. Content:
|
0a26d27
to
62d7ce7
Compare
PNGs are smaller, thanks for the site. The issue with svg is that different browsers render differently, and we actually have a great example right here. In the screenshot of the svg image for @timhoffm it looks like the arrows are not present for some reason, whereas I see arrows colored black in the previews, and when I open in inkscape the arrows colored the same as their lines (what I intended and what the png shows). Tim, do the arrows there resolve the overlaying lines looking weird? Updated to add a little camera cone, I think I like it better even if it makes the plot a bit busier. |
62d7ce7
to
e150772
Compare
Wondering if for this PR or a follow on, the section in the 3D FAQ can be added/consolidated into the doc? |
Are you asking for the view angles to be added to the FAQ, or the FAQ info to be interspersed elsewhere where it makes sense? |
If the relevant parts of the FAQ can be incorporated into the new document so that information isn't spread across two. |
I don't see anything in the FAQ that I think it makes sense to pull out to the new page, but I'm happy to just put all the new info into the existing FAQ. |
Then just forget my suggestion, (sorry) since I like this is a standalone & think it's more discoverable that way (I'm not a big fan of FAQs) |
The camera looks good and the arrow also resolves my line issue 👍. One additional idea for decluttering: How about only indicating the roll direction: Technically, that's a bit different than the azimuth/elevation arrows, which show magnitude, but I think people still understand what roll is. Maybe even show the viewing plane for roll=0, which again may be easier to comprehend as the user has less angles to process. The roll arrow then just indicates "this is the direction roll would apply to" |
OK! I get the size and rendering issue, but wouldn't it make sense to have the "box" as svg so that it can easily be resized when printing? (Given that the size is not completely off. Or generate that image on the fly? I assume it is generate with mpl?) |
9e92ed9
to
573f93a
Compare
573f93a
to
ed883da
Compare
Ok, addressed those comments. I didn't totally go with Tim's suggestion since I think showing the roll angle zero reference is important, but I did take out two of the other lines there that weren't adding much. And to Oscar's suggestion, I made the unfolded box plot a gallery example with the generating code right there. I think it all looks good! Built docs API page: https://output.circle-artifacts.com/output/job/0162ce41-cee3-47e2-a5a8-61aa17145914/artifacts/0/doc/build/html/api/toolkits/mplot3d/view_angles.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Optional: It may be neat to add the fold lines to the unfolded view. But we can always add that later. I'd like to get this into 3.6 docs. So we should merge soon.
axd[plane].view_init(elev=views[i][1][0], | ||
azim=views[i][1][1], | ||
roll=views[i][1][2]) | ||
axd[plane].set_box_aspect(None, zoom=1.25) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be a good use for axs[plane].axis('equal')
? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cutout should work for any aspect box :). But right now that command would only change the data limits! Need #23552 to merge in to change the box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's to this later then. Since we've already released 3.6 RC1, #23552 can't go into 3.6 anymore.
@scottshambaugh thanks! |
…721-on-v3.6.x Backport PR #23721 on branch v3.6.x (3d plot view angle documentation)
PR Summary
Adds documentation and images for the 3d plot view angle conventions. Also adds an example showing the primary view planes. Closes #21508
Inkscape file to generate the view angles plot is attached (the arrows render weird in the svg preview here for some reason).

PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).