File:Cusp catastrophe animation gif.gif
Cusp_catastrophe_animation_gif.gif (480 × 480 pixels, file size: 21.32 MB, MIME type: image/gif, looped, 300 frames, 10 s)
Captions
Summary
[edit]DescriptionCusp catastrophe animation gif.gif |
English: ```python
from mpl_toolkits import mplot3d import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation video_length = 10 # in seconds video_fps = 30 num_frames = video_fps * video_length angle_per_frame = (360 / num_frames) stride = 5 width = 3 a = np.linspace(-width, width, 500) b = a x, y = np.meshgrid(a, b) z = np.clip(-0.1 * (x**4 + y**4) - y**3 + x * y , -5, 5) plt.tick_params(left = False) fig = plt.figure(figsize= (10,10)) ax = plt.axes(projection ='3d') frame = ax.plot_wireframe(x, y, z, color ='#4a5a90', rstride=stride, cstride=stride) def init(): ax.set_box_aspect((1,1,1)) ax.view_init(0, -90) ax.axis('off') ax.set_xlim(-1,1) ax.set_ylim(-1,1) ax.set_zlim(-1, 1) return frame,
def animate(i): ax.view_init(0, -90 + angle_per_frame * i) return frame,
anim = animation.FuncAnimation(fig, animate, init_func=init, frames=num_frames, blit=True) anim.save('cusp.mp4', fps=video_fps, extra_args=['-vcodec', 'libx264']) plt.show() ``` |
Date | |
Source | Own work |
Author | Cosmia Nebula |
Licensing
[edit]- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 22:03, 4 January 2023 | 480 × 480 (21.32 MB) | Cosmia Nebula (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org