-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
3D Animation gallery followups #7087
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
Sure, this is easy. It looks like you have done it already?
I don't know how. Let me study your code. |
|
This is a PR, so these are the things I've already done - I was hoping you could take a look and make sure I didn't butcher the original intent of your examples too much! Sorry for the confusion :) |
Sorry for my confusion. I'll have a look tomorrow. |
Looks better, thanks! A few suggestions:
Do you think that a frame redraw is never needed i.e. can always be avoided? For a new follow up PR I would like to see a new hopefully similar example but which utilities |
|
Finally, rather than just deleting my original module you should rename it and edit to become one of your examples, to make your changs trackable and comparable with my original. |
| ax.plot(*nodes[0], alpha=1, marker="s", color="red") | ||
| ax.grid(False) | ||
| ax.set_axis_off() | ||
| plt.tight_layout() |
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.
This gives me a warning:
UserWarning: The figure layout has changed to tight
plt.tight_layout()
delete, and use
fig = plt.figure(layout='tight')
below instead
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.
The problem with this is that the "tightness" can only be determined after the axis object is added. I went ahead and used fig.tight_layout() after the fig.add_subplot call, which should be equivalent.
| ax.view_init(index * 0.2, index * 0.5) | ||
|
|
||
|
|
||
| fig = plt.figure() |
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.
fig = plt.figure(layout="tight")
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.
See above
96892a3 to
26cc43b
Compare
rossbar
left a comment
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.
Despite the fact that this PR creates two examples from one (doubling the number of animations), it still improves the total example runtime (from 11sec -> ~6sec on my local machine) compared to the version on main.
Also, it may not be the best practice for a contributor to mark a suggestion as "resolved" unless possibly in trivial cases as it makes the follow-up reviewing more difficult... |
It's much more efficient to set the artists data attributes rather than redraw everything each frame.
- shorter titles - set seeds - Fix intersphinx link
Co-authored-by: Andrew Knyazev <andrew.knyazev@ucdenver.edu>
c3cae19 to
60f3897
Compare
FWIW I had done so, i.e. used The only thing I could think to do to alleviate this was the following:
At this point, there are two new files with content identical to the original Now, to make the changes to the file contents reviewable in github, I can squash all of the changes from the individual commits and apply them to the new files. I couldn't figure out how to do this all with only rebasing, so I had to resort to creating a new branch and using a combination of |
* Split 3d animation into two examples. * Rename example, preserve provenance. * Apply updates to 3d anim examples. * Change back to spectral layout. * Update examples/3d_drawing/plot_3d_animation_walk.py Co-authored-by: Dan Schult <dschult@colgate.edu> --------- Co-authored-by: Andrew Knyazev <andrew.knyazev@ucdenver.edu> Co-authored-by: Dan Schult <dschult@colgate.edu>
Follow-up to #7025
The main things are:
What do you think @lobpcg ?