Skip to content

Commit

Permalink
Apply fix to logic in NH original recipe 17
Browse files Browse the repository at this point in the history
  • Loading branch information
sadielbartholomew committed Oct 3, 2024
1 parent 21c3438 commit d4cb7e3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/source/recipes/plot_17_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# Here I've used sample data ggap.nc (and later pressure=850), but you could use tas_A1.nc
# (with time=15)

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

# %%
# 3. Choose a set of predefined colour scales to view (based on NCAR)
Expand Down Expand Up @@ -75,15 +76,15 @@
for i, colour_scale in enumerate(colour_scale):
cfp.gpos(i + 1)
cfp.mapset(proj="cyl")
cfp.cscale(colour_scale[i])
cfp.cscale(colour_scale)
if i == len(colour_scale) + 1:
cfp.con(
f.subspace(pressure=850),
lines=False,
title=colour_scale[i],
title=colour_scale,
colorbar_position=[0.1, 0.1, 0.8, 0.02],
colorbar_orientation="horizontal",
)
else:
cfp.con(f.subspace(pressure=850), title=colour_scale[i], lines=False)
cfp.con(f.subspace(pressure=850), title=colour_scale, lines=False)
cfp.gclose(view=True)

0 comments on commit d4cb7e3

Please sign in to comment.