Skip to content

Commit

Permalink
Merge pull request #332 from jhemedin/deprecation
Browse files Browse the repository at this point in the history
Deprecation Warning fix
  • Loading branch information
zssherman authored Jun 10, 2021
2 parents dbcdddd + f89fcb9 commit efdbe1a
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions act/plotting/timeseriesdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def plot(self, field, dsname=None, subplot_index=(0, ),
cmap=None, set_title=None,
add_nan=False, day_night_background=False,
invert_y_axis=False, abs_limits=(None, None), time_rng=None,
y_rng=None, use_var_for_y=None,
y_rng=None, use_var_for_y=None, set_shading=True,
assessment_overplot=False,
overplot_marker='.',
overplot_behind=False,
Expand Down Expand Up @@ -302,6 +302,11 @@ def plot(self, field, dsname=None, subplot_index=(0, ),
instances where data has an index-based dimension instead of a
height-based dimension. If shapes of arrays do not match it will
automatically revert back to the original ydata.
set_shading : boolean
Option to to set the matplotlib.pcolormesh shading parameter to 'auto'.
Set set_shading=False to set the shading parameter using kwargs.
If set_shading is set to False and no shading kwarg is set, matplotlib defaults to
shading='flat'.
assessment_overplot : boolean
Option to overplot quality control colored symbols over plotted
data using flag_assessment categories.
Expand Down Expand Up @@ -467,8 +472,17 @@ def plot(self, field, dsname=None, subplot_index=(0, ),
# Add in nans to ensure the data are not streaking
if add_nan is True:
xdata, data = data_utils.add_in_nan(xdata, data)
mesh = ax.pcolormesh(np.asarray(xdata), ydata, data.transpose(),
cmap=cmap, edgecolors='face', **kwargs)

# Sets shading parameter to auto. Matplotlib will check deminsions.
# If X,Y and C are same deminsions shading is set to nearest.
# If X and Y deminsions are 1 greater than C shading is set to flat.
if set_shading:
mesh = ax.pcolormesh(np.asarray(xdata), ydata, data.transpose(),
shading='auto', cmap=cmap, edgecolors='face',
**kwargs)
else:
mesh = ax.pcolormesh(np.asarray(xdata), ydata, data.transpose(),
cmap=cmap, edgecolors='face', **kwargs)

# Set Title
if set_title is None:
Expand Down

0 comments on commit efdbe1a

Please sign in to comment.