Problem matplotlib animation
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- jupyter-notebook, python
- Bereich
- data-visualization
Rechercherichtung
Beginne damit, den bereitgestellten Notebook-Code mit %matplotlib widget auszuführen, und vergleiche ihn mit demselben Code als Skript. Untersuche, warum repeat=False ignoriert wird, und überprüfe, dass die Animation nach den angeforderten 200 Frames stoppt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Dear all,
I have tried to make an animation with jupyter-matplotlib. It has worked, but despite the repeat=False flag it just repeats forever. The example is taken from a tutorial. This does not happen if I just use the code as a script.
%matplotlib widget
"""
Matplotlib Animation Example
author: Jake Vanderplas
email: [email protected]
website: http://jakevdp.github.com
license: BSD
Please feel free to use and modify this, but keep the above information. Thanks!
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, 2), ylim=(-2, 2))
line, = ax.plot([], [], lw=2)
# initialization function: plot the background of each frame
def init():
line.set_data([], [])
return line,
# animation function. This is called sequentially
def animate(i):
x = np.linspace(0, 2, 1000)
y = np.sin(2 * np.pi * (x - 0.01 * i))
line.set_data(x, y)
ax.set_title(str(i))
return line,
# call the animator. blit=True means only re-draw the parts that have changed.
anim = animation.FuncAnimation(fig, animate, init_func=init,
frames=200, interval=20, blit=True,repeat=False)
# save the animation as an mp4. This requires ffmpeg or mencoder to be
# installed. The extra_args ensure that the x264 codec is used, so that
# the video can be embedded in html5. You may need to adjust this for
# your system: for more information, see
# http://matplotlib.sourceforge.net/api/animation_api.html
anim.save('basic_animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])
plt.show()
Thanks a lot!
Sergio
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 1.7k
- Forks
- 236
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus matplotlib/ipympl
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
matplotlib/ipympl#623 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
matplotlib/ipympl#622 · 13 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
matplotlib/ipympl#612 ·
-
DeprecationWarning: Passing unrecognized arguments to super(Toolbar).__init__().Evtl. vergeben @pradeep14012004 hat das vor 7 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
matplotlib/ipympl#611 · 4 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
matplotlib/ipympl#609 · 7 Kommentare ·
Alle Issues in matplotlib/ipympl
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
arviz-devs/arviz-plots#587 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
facioquo/stock-charts#612 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
semanticpixel/theluistorres#250 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: respect granularity when limiting analytics time-series bucketsEvtl. vergeben @Sparsh2105 hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
AOSSIE-Org/OrgExplorer#333 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
techniq/layerchart#940 ·
Maintainer antworten meist innerhalb von 1 Tag