Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 18 additions & 34 deletions pydda/vis/barb_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ def plot_horiz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(u_vel_contours), np.max(u_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="U [m/s]")
Expand All @@ -211,8 +210,7 @@ def plot_horiz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(v_vel_contours), np.max(v_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="V [m/s]")
Expand All @@ -227,8 +225,7 @@ def plot_horiz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(w_vel_contours), np.max(w_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="W [m/s]")
Expand All @@ -244,8 +241,7 @@ def plot_horiz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand All @@ -261,7 +257,7 @@ def plot_horiz_xsection_barbs(
grid_y[level, :, :],
bca,
levels=[bca_min, bca_max],
color="k",
colors="k",
)

if axes_labels_flag is True:
Expand Down Expand Up @@ -469,8 +465,7 @@ def plot_horiz_xsection_barbs_map(
extend="both",
)
cs.set_clim([np.min(u_vel_contours), np.max(u_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -500,8 +495,7 @@ def plot_horiz_xsection_barbs_map(
extend="both",
)
cs.set_clim([np.min(v_vel_contours), np.max(v_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -531,8 +525,7 @@ def plot_horiz_xsection_barbs_map(
extend="both",
)
cs.set_clim([np.min(w_vel_contours), np.max(w_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -563,8 +556,7 @@ def plot_horiz_xsection_barbs_map(
levels=wind_vel_contours,
linewidths=2,
)
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")

ax.clabel(cs)
if colorbar_contour_flag is True:
Expand Down Expand Up @@ -596,7 +588,7 @@ def plot_horiz_xsection_barbs_map(
grid_lat[::, ::],
bca,
levels=[bca_min, bca_max],
color="k",
colors="k",
zorder=1,
)

Expand Down Expand Up @@ -790,8 +782,7 @@ def plot_xz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(u_vel_contours), np.max(u_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="U [m/s]", extend="min")
Expand All @@ -806,8 +797,7 @@ def plot_xz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(v_vel_contours), np.max(v_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="V [m/s]", extend="min")
Expand All @@ -822,8 +812,7 @@ def plot_xz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(w_vel_contours), np.max(w_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="W [m/s]", extend="min")
Expand All @@ -839,8 +828,7 @@ def plot_xz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand Down Expand Up @@ -1035,8 +1023,7 @@ def plot_yz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(u_vel_contours), np.max(u_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
plt.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="U [m/s]", extend="min")
Expand All @@ -1051,8 +1038,7 @@ def plot_yz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(v_vel_contours), np.max(v_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
plt.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="V [m/s]", extend="min")
Expand All @@ -1067,8 +1053,7 @@ def plot_yz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(w_vel_contours), np.max(w_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
plt.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="W [m/s]", extend="min")
Expand All @@ -1084,8 +1069,7 @@ def plot_yz_xsection_barbs(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand Down
27 changes: 8 additions & 19 deletions pydda/vis/quiver_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ def plot_horiz_xsection_quiver(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand Down Expand Up @@ -598,9 +597,7 @@ def plot_horiz_xsection_quiver_map(
extend="both",
)
cs.set_clim([np.min(u_vel_contours), np.max(u_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_over(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", over="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -630,9 +627,7 @@ def plot_horiz_xsection_quiver_map(
extend="both",
)
cs.set_clim([np.min(v_vel_contours), np.max(v_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_over(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", over="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -662,9 +657,7 @@ def plot_horiz_xsection_quiver_map(
extend="both",
)
cs.set_clim([np.min(w_vel_contours), np.max(w_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_over(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", over="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -695,9 +688,7 @@ def plot_horiz_xsection_quiver_map(
levels=wind_vel_contours,
linewidths=2,
)
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)

cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -728,7 +719,7 @@ def plot_horiz_xsection_quiver_map(
grid_lat[:, :],
bca,
levels=[bca_min, bca_max],
color="k",
colors="k",
zorder=1,
)

Expand Down Expand Up @@ -1021,8 +1012,7 @@ def plot_xz_xsection_quiver(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand Down Expand Up @@ -1316,8 +1306,7 @@ def plot_yz_xsection_quiver(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand Down
28 changes: 9 additions & 19 deletions pydda/vis/streamline_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ def plot_horiz_xsection_streamlines(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand All @@ -253,7 +252,7 @@ def plot_horiz_xsection_streamlines(
grid_y[level, :, :],
bca,
levels=[bca_min, bca_max],
color="k",
colors="k",
)

if axes_labels_flag is True:
Expand Down Expand Up @@ -477,9 +476,7 @@ def plot_horiz_xsection_streamlines_map(
extend="both",
)
cs.set_clim([np.min(u_vel_contours), np.max(u_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_over(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white", over="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -509,9 +506,7 @@ def plot_horiz_xsection_streamlines_map(
extend="both",
)
cs.set_clim([np.min(v_vel_contours), np.max(v_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_over(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white", over="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -541,9 +536,7 @@ def plot_horiz_xsection_streamlines_map(
extend="both",
)
cs.set_clim([np.min(w_vel_contours), np.max(w_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_over(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white", over="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(
Expand Down Expand Up @@ -574,8 +567,7 @@ def plot_horiz_xsection_streamlines_map(
levels=wind_vel_contours,
linewidths=2,
)
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")

ax.clabel(cs)
if colorbar_contour_flag is True:
Expand Down Expand Up @@ -607,7 +599,7 @@ def plot_horiz_xsection_streamlines_map(
grid_lat[:, :],
bca,
levels=[bca_min, bca_max],
color="k",
colors="k",
zorder=1,
)

Expand Down Expand Up @@ -844,8 +836,7 @@ def plot_xz_xsection_streamlines(
linewidths=2,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand Down Expand Up @@ -1082,8 +1073,7 @@ def plot_yz_xsection_streamlines(
alpha=contour_alpha,
)
cs.set_clim([np.min(wind_vel_contours), np.max(wind_vel_contours)])
cs.cmap.set_under(color="white", alpha=0)
cs.cmap.set_bad(color="white", alpha=0)
cs.cmap.with_extremes(under="white", bad="white")
ax.clabel(cs)
if colorbar_contour_flag is True:
plt.colorbar(cs, ax=ax, label="|V| [m/s]")
Expand Down
Loading