Skip to content

Commit cb16792

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ced6cc3 commit cb16792

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

docs/paper/plotting_functions.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ def plot_drifters(drifter_ds, ax, vmin, vmax, PLOT_VARIABLE="temperature"):
5252
edgecolor="black",
5353
zorder=4,
5454
transform=PROJ,
55-
label="Waypoint"
56-
if i == 0
57-
else None, # only label first for legend
55+
label="Waypoint" if i == 0 else None, # only label first for legend
5856
)
5957

6058
# additional map features
@@ -204,10 +202,29 @@ def plot_adcp(ds, ax, axes_labels=False):
204202
# =====================================================
205203

206204

207-
def _add_cmap(da, cmap, ax, label, vmin, vmax, orientation="horizontal", shrink=0.90, fraction=0.05, pad=0.2):
205+
def _add_cmap(
206+
da,
207+
cmap,
208+
ax,
209+
label,
210+
vmin,
211+
vmax,
212+
orientation="horizontal",
213+
shrink=0.90,
214+
fraction=0.05,
215+
pad=0.2,
216+
):
208217
sm = plt.cm.ScalarMappable(cmap=cmap, norm=mcolors.Normalize(vmin, vmax))
209218
sm._A = []
210-
plt.colorbar(sm, ax=ax, orientation=orientation, label=label, shrink=shrink, fraction=fraction, pad=pad)
219+
plt.colorbar(
220+
sm,
221+
ax=ax,
222+
orientation=orientation,
223+
label=label,
224+
shrink=shrink,
225+
fraction=fraction,
226+
pad=pad,
227+
)
211228

212229

213230
def _haversine(lon1, lat1, lon2, lat2):

0 commit comments

Comments
 (0)