|
46 | 46 | }
|
47 | 47 |
|
48 | 48 | # %%
|
49 |
| -# 6. Create and open the plot file: |
50 |
| -cfp.gopen( |
51 |
| - rows=2, columns=1, bottom=0.1, top=0.85, file="global_avg_sst_plot.png" |
52 |
| -) |
53 |
| - |
54 |
| -# %% |
55 |
| -# 7. Put maxima subplot at top since these values are higher, given |
56 |
| -# increasing x axis. Note we set limits manually with 'gset' only to |
| 49 | +# 6. Create and open the plot file. Put maxima subplot at top since these |
| 50 | +# values are higher, given increasing x axis. |
| 51 | +# Note we set limits manually with 'gset' only to |
57 | 52 | # allow space so the legend doesn't overlap the data, which isn't
|
58 | 53 | # possible purely from positioning it anywhere within the default plot.
|
59 | 54 | # Otherwise cf-plot handles this for us. To plot the per-season means
|
60 | 55 | # of the maxima, we loop through the season query mapping and do a
|
61 | 56 | # "T: mean" collapse setting the season as the grouping:
|
| 57 | +cfp.gopen( |
| 58 | + rows=2, columns=1, bottom=0.1, top=0.85, file="global_avg_sst_plot.png" |
| 59 | +) |
62 | 60 | cfp.gpos(1)
|
63 | 61 | cfp.gset(xmin="1980-01-01", xmax="2022-12-01", ymin=304, ymax=312)
|
64 | 62 | for colour, season_query in colours_seasons_mapping.items():
|
|
78 | 76 | xlabel="",
|
79 | 77 | label="All months",
|
80 | 78 | )
|
81 |
| - |
82 |
| -# %% |
83 |
| -# 8. Create and add minima subplot below the maxima one. Just like for the |
| 79 | +# Create and add minima subplot below the maxima one. Just like for the |
84 | 80 | # maxima case, we plot per-season means by looping through the season query
|
85 |
| -# mapping and doing a "T: mean" collapse setting the season as the grouping: |
| 81 | +# mapping and doing a "T: mean" collapse setting the season as the grouping |
86 | 82 | cfp.gpos(2)
|
87 | 83 | cfp.gset(xmin="1980-01-01", xmax="2022-12-01", ymin=269, ymax=272)
|
88 | 84 | for colour, season_query in colours_seasons_mapping.items():
|
|
100 | 96 | am_min,
|
101 | 97 | color="grey",
|
102 | 98 | )
|
103 |
| - |
104 |
| -# %% |
105 |
| -# 9. Add an overall title to the plot and close the file to save it: |
| 99 | +# Add an overall title to the plot and close the file to save it |
106 | 100 | plt.suptitle(
|
107 | 101 | "Global mean sea surface temperature (SST) monthly\nminima and maxima "
|
108 | 102 | "showing seasonal means of these extrema",
|
|
0 commit comments