Skip to content

Commit

Permalink
🐛 Draw with colorbar
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Dec 17, 2024
1 parent aadb57d commit 78fd7a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/arpes/plotting/movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,19 @@ def plot_movie( # noqa: PLR0913
kwargs["vmax"] = np.max([np.abs(kwargs["vmin"]), np.abs(kwargs["vmax"])])
kwargs["vmin"] = -kwargs["vmax"]

def init() -> Iterable[Artist]:
data.isel({time_dim: 0}).plot.pcolormesh(ax=ax, add_colorbar=True, **kwargs)
return ax

def update(frame: int) -> Iterable[Artist]:
ax.clear()
return ax.pcolormesh(data.isel({time_dim: frame}).values, **kwargs)
data.isel({time_dim: frame}).plot.pcolormesh(ax=ax, add_colorbar=False, **kwargs)
return ax

anim: animation.FuncAnimation = animation.FuncAnimation(
fig=fig,
func=update,
init_func=init,
frames=data.sizes[time_dim],
interval=interval_ms,
)
Expand Down

0 comments on commit 78fd7a2

Please sign in to comment.