Skip to content

Commit d4cb7e3

Browse files
Apply fix to logic in NH original recipe 17
1 parent 21c3438 commit d4cb7e3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/source/recipes/plot_17_recipe.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
# Here I've used sample data ggap.nc (and later pressure=850), but you could use tas_A1.nc
1919
# (with time=15)
2020

21-
f = cf.read("~/cfplot_data/ggap.nc")[0]
21+
PATH="~/git-repos/cf-plot/cfplot/test/cfplot_data"
22+
f = cf.read(f"{PATH}/ggap.nc")[0]
2223

2324
# %%
2425
# 3. Choose a set of predefined colour scales to view (based on NCAR)
@@ -75,15 +76,15 @@
7576
for i, colour_scale in enumerate(colour_scale):
7677
cfp.gpos(i + 1)
7778
cfp.mapset(proj="cyl")
78-
cfp.cscale(colour_scale[i])
79+
cfp.cscale(colour_scale)
7980
if i == len(colour_scale) + 1:
8081
cfp.con(
8182
f.subspace(pressure=850),
8283
lines=False,
83-
title=colour_scale[i],
84+
title=colour_scale,
8485
colorbar_position=[0.1, 0.1, 0.8, 0.02],
8586
colorbar_orientation="horizontal",
8687
)
8788
else:
88-
cfp.con(f.subspace(pressure=850), title=colour_scale[i], lines=False)
89+
cfp.con(f.subspace(pressure=850), title=colour_scale, lines=False)
8990
cfp.gclose(view=True)

0 commit comments

Comments
 (0)