# Generating an animation example

**URL:** https://forum.generic-mapping-tools.org/t/generating-an-animation-example/3406
**Category:** PyGMT Q&A
**Created:** [November 4, 2022, 9:55pm UTC](https://forum.generic-mapping-tools.org/t/generating-an-animation-example/3406 "2022-11-04T21:55:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mtabbakhha](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mtabbakhha](https://forum.generic-mapping-tools.org/u/mtabbakhha)
#### Post date: [November 4, 2022, 9:55pm UTC](https://forum.generic-mapping-tools.org/t/generating-an-animation-example/3406/1 "2022-11-04T21:55:27Z")

</div>

Hi all,

I am new to pygmt and wanted to generate an animation for an earthquake. I could generate an image for maximum values but I don’t know how can I generate an animation. Is there any example so that I can work with and take a look at input data to see how does it work?

Thanks so much

---

<div class="post-metadata">

### Author: ![weiji14](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/weiji14/32/33_2.png) [@weiji14](https://forum.generic-mapping-tools.org/u/weiji14)
#### Post date: [November 5, 2022, 12:55pm UTC](https://forum.generic-mapping-tools.org/t/generating-an-animation-example/3406/2 "2022-11-05T12:55:56Z")

</div>

Welcome @mtabbakhha! So the command you’ll need to use is [`gmt movie`](https://docs.generic-mapping-tools.org/6.4/movie.html), which unfortunately isn’t wrapped in PyGMT yet (see [Wrapping movie for pyGMT](https://flint.soest.hawaii.edu/t/wrapping-movie-for-pygmt/2890)). That said, you can check out these examples:

- [8 - One year (2018) of Pacific seismicity events](https://docs.generic-mapping-tools.org/6.4/animations/anim08.html#one-year-2018-of-pacific-seismicity-events)
- [14 - Animating earthquake focal mechanisms](https://docs.generic-mapping-tools.org/6.4/animations/anim14.html#animating-earthquake-focal-mechanisms)
- [https://github.com/weiji14/30DayMapChallenge2021/blob/main/day20\_movement.py#L100-L121](https://github.com/weiji14/30DayMapChallenge2021/blob/main/day20_movement.py#L100-L121)

You would need to write a shell script (\*.sh or \*.bat) that handles the plotting of each frame, and then do `gmt movie nameofscript.sh ...` which will loop over your script, generate each movie frame and make the final animation. Let us know if you need help any help. Good luck!

---

<div class="post-metadata">

### Author: ![mtabbakhha](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mtabbakhha](https://forum.generic-mapping-tools.org/u/mtabbakhha)
#### Post date: [November 7, 2022, 10:17pm UTC](https://forum.generic-mapping-tools.org/t/generating-an-animation-example/3406/3 "2022-11-07T22:17:08Z")

</div>

thank you so much for your help.
