Skip to content

Commit 4f321b4

Browse files
committed
fix: Colorbar scaling problems, Change uv colormaps
1 parent 80efae9 commit 4f321b4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/pyvisgrid/plotting/animations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def plot_observation_state(
214214
"axes_labels": True,
215215
"axes_fontsize": "x-small",
216216
"show_times": True,
217-
"cmap": "viridis",
217+
"cmap": "magma",
218218
"show_cbar": True,
219219
"cbar_ticks": True,
220220
"cbar_label": True,

src/pyvisgrid/plotting/plotting.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def plot_ungridded_uv(
193193
mode: str = "wave",
194194
show_times: bool = True,
195195
use_relative_time: bool = True,
196-
time_cmap: str | matplotlib.colors.Colormap = "inferno",
196+
time_cmap: str | matplotlib.colors.Colormap = "magma",
197197
marker_size: float | None = None,
198198
aspect_args: dict | None = None,
199199
plot_args: dict = None,
@@ -492,9 +492,16 @@ def plot_mask(
492492
origin="lower",
493493
interpolation="none",
494494
cmap=cmap,
495+
vmin=-np.pi,
496+
vmax=np.pi,
495497
**plot_args,
496498
)
497-
cbar = _configure_colorbar(mappable=im, ax=ax, fig=fig, label="Phase / rad")
499+
cbar = _configure_colorbar(
500+
mappable=im,
501+
ax=ax,
502+
fig=fig,
503+
label="Phase / rad",
504+
)
498505
cbar.set_ticks(np.arange(-np.pi, 3 / 2 * np.pi, np.pi / 2))
499506
cbar.set_ticklabels(["$-\\pi$", "$-\\pi/2$", "$0$", "$\\pi/2$", "$\\pi$"])
500507
case "real":

0 commit comments

Comments
 (0)