@@ -850,6 +850,8 @@ def plot_barbs_from_u_v(
850
850
invert_y_axis = True ,
851
851
num_barbs_x = 20 ,
852
852
num_barbs_y = 20 ,
853
+ barb_step_x = None ,
854
+ barb_step_y = None ,
853
855
use_var_for_y = None ,
854
856
** kwargs ,
855
857
):
@@ -883,6 +885,12 @@ def plot_barbs_from_u_v(
883
885
The number of wind barbs to plot in the x axis.
884
886
num_barbs_y : int
885
887
The number of wind barbs to plot in the y axis.
888
+ barb_step_x : int
889
+ Step between each wind barb to plot. If set, will override
890
+ values given for num_barbs_x
891
+ barb_step_y : int
892
+ Step between each wind barb to plot. If set, will override
893
+ values given for num_barbs_y
886
894
cmap : matplotlib.colors.LinearSegmentedColormap
887
895
A color map to use with wind barbs. If this is set the plt.barbs
888
896
routine will be passed the C parameter scaled as sqrt of sum of the
@@ -919,8 +927,9 @@ def plot_barbs_from_u_v(
919
927
v = self ._ds [dsname ][v_field ].values
920
928
dim = list (self ._ds [dsname ][u_field ].dims )
921
929
xdata = self ._ds [dsname ][dim [0 ]].values
922
- num_x = xdata .shape [- 1 ]
923
- barb_step_x = round (num_x / num_barbs_x )
930
+ if barb_step_x is None :
931
+ num_x = xdata .shape [- 1 ]
932
+ barb_step_x = round (num_x / num_barbs_x )
924
933
if barb_step_x == 0 :
925
934
barb_step_x = 1
926
935
@@ -937,8 +946,9 @@ def plot_barbs_from_u_v(
937
946
else :
938
947
units = ''
939
948
ytitle = '' .join (['(' , units , ')' ])
940
- num_y = ydata .shape [0 ]
941
- barb_step_y = round (num_y / num_barbs_y )
949
+ if barb_step_y is None :
950
+ num_y = ydata .shape [0 ]
951
+ barb_step_y = round (num_y / num_barbs_y )
942
952
if barb_step_y == 0 :
943
953
barb_step_y = 1
944
954
0 commit comments