-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- make mp4 animation in the gallery instead of gif - add text to readme & usage - split code into multiple file
- Loading branch information
1 parent
c1318d8
commit cd023ec
Showing
19 changed files
with
934 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _gallery_reference: | ||
|
||
Gallery | ||
------- | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
.. _small_reference: | ||
Simple animation | ||
################ | ||
explain the utilisation of the ``plot`` function | ||
""" | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
ANIM_FPS = 6 | ||
ANIM_OUTPUT_FOLDER = "animation/example_01" | ||
ANIM_MAX_FRAMES = ANIM_FPS * 7 | ||
|
||
|
||
def plot(i, ds): | ||
""" | ||
Parameters | ||
---------- | ||
i: int | ||
indice of the image. | ||
ds: xarray.Dataset | ||
data passed to the plotting function | ||
Returns | ||
------- | ||
fig: matplotlib.figure.Figure | ||
the figure to save | ||
""" | ||
|
||
fig, ax = plt.subplots(1, 1, figsize=(4, 4), dpi=120) | ||
ax.set_xlim(-1, 1) | ||
ax.set_ylim(-1, 1) | ||
|
||
n = i + 7 # starts indices at 7 | ||
x = np.arange(n + 1) / n * 2 * np.pi | ||
ax.plot(np.sin(x), np.cos(x)) | ||
ax.set_title(f"image {i} : n={n}") | ||
return fig |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.