Repository navigation
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.
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.
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.
fig = plt.figure(layout="tight")
96892a3 to
26cc43b
Compare
rossbar
left a comment
There was a problem hiding this comment.
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 <[email protected]>
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 <[email protected]> --------- Co-authored-by: Andrew Knyazev <[email protected]> Co-authored-by: Dan Schult <[email protected]>
Follow-up to #7025
The main things are:
What do you think @lobpcg ?