@@ -195,8 +195,7 @@ def plot_horiz_xsection_barbs(
195195 linewidths = 2 ,
196196 )
197197 cs .set_clim ([np .min (u_vel_contours ), np .max (u_vel_contours )])
198- cs .cmap .set_under (color = "white" , alpha = 0 )
199- cs .cmap .set_bad (color = "white" , alpha = 0 )
198+ cs .cmap .with_extremes (under = "white" , bad = "white" )
200199 ax .clabel (cs )
201200 if colorbar_contour_flag is True :
202201 plt .colorbar (cs , ax = ax , label = "U [m/s]" )
@@ -211,8 +210,7 @@ def plot_horiz_xsection_barbs(
211210 linewidths = 2 ,
212211 )
213212 cs .set_clim ([np .min (v_vel_contours ), np .max (v_vel_contours )])
214- cs .cmap .set_under (color = "white" , alpha = 0 )
215- cs .cmap .set_bad (color = "white" , alpha = 0 )
213+ cs .cmap .with_extremes (under = "white" , bad = "white" )
216214 ax .clabel (cs )
217215 if colorbar_contour_flag is True :
218216 plt .colorbar (cs , ax = ax , label = "V [m/s]" )
@@ -227,8 +225,7 @@ def plot_horiz_xsection_barbs(
227225 linewidths = 2 ,
228226 )
229227 cs .set_clim ([np .min (w_vel_contours ), np .max (w_vel_contours )])
230- cs .cmap .set_under (color = "white" , alpha = 0 )
231- cs .cmap .set_bad (color = "white" , alpha = 0 )
228+ cs .cmap .with_extremes (under = "white" , bad = "white" )
232229 ax .clabel (cs )
233230 if colorbar_contour_flag is True :
234231 plt .colorbar (cs , ax = ax , label = "W [m/s]" )
@@ -244,8 +241,7 @@ def plot_horiz_xsection_barbs(
244241 linewidths = 2 ,
245242 )
246243 cs .set_clim ([np .min (wind_vel_contours ), np .max (wind_vel_contours )])
247- cs .cmap .set_under (color = "white" , alpha = 0 )
248- cs .cmap .set_bad (color = "white" , alpha = 0 )
244+ cs .cmap .with_extremes (under = "white" , bad = "white" )
249245 ax .clabel (cs )
250246 if colorbar_contour_flag is True :
251247 plt .colorbar (cs , ax = ax , label = "|V| [m/s]" )
@@ -261,7 +257,7 @@ def plot_horiz_xsection_barbs(
261257 grid_y [level , :, :],
262258 bca ,
263259 levels = [bca_min , bca_max ],
264- color = "k" ,
260+ colors = "k" ,
265261 )
266262
267263 if axes_labels_flag is True :
@@ -469,8 +465,7 @@ def plot_horiz_xsection_barbs_map(
469465 extend = "both" ,
470466 )
471467 cs .set_clim ([np .min (u_vel_contours ), np .max (u_vel_contours )])
472- cs .cmap .set_under (color = "white" , alpha = 0 )
473- cs .cmap .set_bad (color = "white" , alpha = 0 )
468+ cs .cmap .with_extremes (under = "white" , bad = "white" )
474469 ax .clabel (cs )
475470 if colorbar_contour_flag is True :
476471 plt .colorbar (
@@ -500,8 +495,7 @@ def plot_horiz_xsection_barbs_map(
500495 extend = "both" ,
501496 )
502497 cs .set_clim ([np .min (v_vel_contours ), np .max (v_vel_contours )])
503- cs .cmap .set_under (color = "white" , alpha = 0 )
504- cs .cmap .set_bad (color = "white" , alpha = 0 )
498+ cs .cmap .with_extremes (under = "white" , bad = "white" )
505499 ax .clabel (cs )
506500 if colorbar_contour_flag is True :
507501 plt .colorbar (
@@ -531,8 +525,7 @@ def plot_horiz_xsection_barbs_map(
531525 extend = "both" ,
532526 )
533527 cs .set_clim ([np .min (w_vel_contours ), np .max (w_vel_contours )])
534- cs .cmap .set_under (color = "white" , alpha = 0 )
535- cs .cmap .set_bad (color = "white" , alpha = 0 )
528+ cs .cmap .with_extremes (under = "white" , bad = "white" )
536529 ax .clabel (cs )
537530 if colorbar_contour_flag is True :
538531 plt .colorbar (
@@ -563,8 +556,7 @@ def plot_horiz_xsection_barbs_map(
563556 levels = wind_vel_contours ,
564557 linewidths = 2 ,
565558 )
566- cs .cmap .set_under (color = "white" , alpha = 0 )
567- cs .cmap .set_bad (color = "white" , alpha = 0 )
559+ cs .cmap .with_extremes (under = "white" , bad = "white" )
568560
569561 ax .clabel (cs )
570562 if colorbar_contour_flag is True :
@@ -596,7 +588,7 @@ def plot_horiz_xsection_barbs_map(
596588 grid_lat [::, ::],
597589 bca ,
598590 levels = [bca_min , bca_max ],
599- color = "k" ,
591+ colors = "k" ,
600592 zorder = 1 ,
601593 )
602594
@@ -790,8 +782,7 @@ def plot_xz_xsection_barbs(
790782 linewidths = 2 ,
791783 )
792784 cs .set_clim ([np .min (u_vel_contours ), np .max (u_vel_contours )])
793- cs .cmap .set_under (color = "white" , alpha = 0 )
794- cs .cmap .set_bad (color = "white" , alpha = 0 )
785+ cs .cmap .with_extremes (under = "white" , bad = "white" )
795786 ax .clabel (cs )
796787 if colorbar_contour_flag is True :
797788 plt .colorbar (cs , ax = ax , label = "U [m/s]" , extend = "min" )
@@ -806,8 +797,7 @@ def plot_xz_xsection_barbs(
806797 linewidths = 2 ,
807798 )
808799 cs .set_clim ([np .min (v_vel_contours ), np .max (v_vel_contours )])
809- cs .cmap .set_under (color = "white" , alpha = 0 )
810- cs .cmap .set_bad (color = "white" , alpha = 0 )
800+ cs .cmap .with_extremes (under = "white" , bad = "white" )
811801 ax .clabel (cs )
812802 if colorbar_contour_flag is True :
813803 plt .colorbar (cs , ax = ax , label = "V [m/s]" , extend = "min" )
@@ -822,8 +812,7 @@ def plot_xz_xsection_barbs(
822812 linewidths = 2 ,
823813 )
824814 cs .set_clim ([np .min (w_vel_contours ), np .max (w_vel_contours )])
825- cs .cmap .set_under (color = "white" , alpha = 0 )
826- cs .cmap .set_bad (color = "white" , alpha = 0 )
815+ cs .cmap .with_extremes (under = "white" , bad = "white" )
827816 ax .clabel (cs )
828817 if colorbar_contour_flag is True :
829818 plt .colorbar (cs , ax = ax , label = "W [m/s]" , extend = "min" )
@@ -839,8 +828,7 @@ def plot_xz_xsection_barbs(
839828 linewidths = 2 ,
840829 )
841830 cs .set_clim ([np .min (wind_vel_contours ), np .max (wind_vel_contours )])
842- cs .cmap .set_under (color = "white" , alpha = 0 )
843- cs .cmap .set_bad (color = "white" , alpha = 0 )
831+ cs .cmap .with_extremes (under = "white" , bad = "white" )
844832 ax .clabel (cs )
845833 if colorbar_contour_flag is True :
846834 plt .colorbar (cs , ax = ax , label = "|V| [m/s]" )
@@ -1035,8 +1023,7 @@ def plot_yz_xsection_barbs(
10351023 linewidths = 2 ,
10361024 )
10371025 cs .set_clim ([np .min (u_vel_contours ), np .max (u_vel_contours )])
1038- cs .cmap .set_under (color = "white" , alpha = 0 )
1039- cs .cmap .set_bad (color = "white" , alpha = 0 )
1026+ cs .cmap .with_extremes (under = "white" , bad = "white" )
10401027 plt .clabel (cs )
10411028 if colorbar_contour_flag is True :
10421029 plt .colorbar (cs , ax = ax , label = "U [m/s]" , extend = "min" )
@@ -1051,8 +1038,7 @@ def plot_yz_xsection_barbs(
10511038 linewidths = 2 ,
10521039 )
10531040 cs .set_clim ([np .min (v_vel_contours ), np .max (v_vel_contours )])
1054- cs .cmap .set_under (color = "white" , alpha = 0 )
1055- cs .cmap .set_bad (color = "white" , alpha = 0 )
1041+ cs .cmap .with_extremes (under = "white" , bad = "white" )
10561042 plt .clabel (cs )
10571043 if colorbar_contour_flag is True :
10581044 plt .colorbar (cs , ax = ax , label = "V [m/s]" , extend = "min" )
@@ -1067,8 +1053,7 @@ def plot_yz_xsection_barbs(
10671053 linewidths = 2 ,
10681054 )
10691055 cs .set_clim ([np .min (w_vel_contours ), np .max (w_vel_contours )])
1070- cs .cmap .set_under (color = "white" , alpha = 0 )
1071- cs .cmap .set_bad (color = "white" , alpha = 0 )
1056+ cs .cmap .with_extremes (under = "white" , bad = "white" )
10721057 plt .clabel (cs )
10731058 if colorbar_contour_flag is True :
10741059 plt .colorbar (cs , ax = ax , label = "W [m/s]" , extend = "min" )
@@ -1084,8 +1069,7 @@ def plot_yz_xsection_barbs(
10841069 linewidths = 2 ,
10851070 )
10861071 cs .set_clim ([np .min (wind_vel_contours ), np .max (wind_vel_contours )])
1087- cs .cmap .set_under (color = "white" , alpha = 0 )
1088- cs .cmap .set_bad (color = "white" , alpha = 0 )
1072+ cs .cmap .with_extremes (under = "white" , bad = "white" )
10891073 ax .clabel (cs )
10901074 if colorbar_contour_flag is True :
10911075 plt .colorbar (cs , ax = ax , label = "|V| [m/s]" )
0 commit comments