Skip to content
Snippets Groups Projects
Commit faa99ac9 authored by Andi Gerken's avatar Andi Gerken
Browse files

Added show option for file.plot()

parent 96d4439e
No related branches found
No related tags found
No related merge requests found
Pipeline #47241 passed
......@@ -687,6 +687,7 @@ class File(h5py.File):
cmap="Set1",
skip_timesteps=0,
max_timesteps=None,
show=False,
):
"""Plot the file using matplotlib.pyplot
......@@ -701,6 +702,7 @@ class File(h5py.File):
cmap (matplotlib.colors.Colormap, optional): The colormap to use
skip_timesteps (int, optional): Skip timesteps in the begining of the file
max_timesteps (int, optional): Cut of timesteps in the end of the file.
show (bool, optional): Show the created plot.
Returns:
matplotlib.axes: The axes object with the plot.
"""
......@@ -784,6 +786,10 @@ class File(h5py.File):
ax.legend(loc="lower right")
ax.set_xlabel("x [cm]")
ax.set_ylabel("y [cm]")
if show:
plt.show()
return ax
def render(self, video_path=None, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment