<jupyter_start><jupyter_text>An example producing filled contour maps, scatter maps and color bars at specified locations on the pageThis makes use of - ./CASutils/maplot_utils.py to plot the maps- ./CASutils/colorbar_utils.py to plot the color bars- ./CASutils/colormap_utils.py is used to make a custon color bar<jupyter_code>import importlib
import xarray as xr
import matplotlib.pyplot as plt
import matplotlib as mpl
import sys
import numpy as np

from CASutils import colormap_utils as mycolors
from CASutils import mapplot_utils as maps
from CASutils import colorbar_utils as cbars


importlib.reload(mycolors)
importlib.reload(maps)
importlib.reload(cbars)
import cartopy.crs as ccrs
import cartopy.feature as cfeature<jupyter_output><empty_output><jupyter_text>read in the data<jupyter_code>bestpath="/project/cas/islas/savs/python/snowpaper/DATA_SORT/deseasonalized_tvar/TVAR_BEST.nc"
best = xr.open_dataset(bestpath)
isdpath="/project/cas/islas/savs/python/snowpaper/DATA_SORT/deseasonalized_tvar/TVAR_ISD.nc"
isd=xr.open_dataset(isdpath)e
era5path = "/project/cas/islas/savs/python/snowpaper/DATA_SORT/deseasonalized_tvar/TVAR_ERA5.nc"
era5 = xr.open_dataset(era5path)
goga1path="/project/cas/islas/savs/python/snowpaper/DATA_SORT/deseasonalized_tvar/TVAR_GOGA1.nc"
goga1 = xr.open_dataset(goga1path)
goga1varm = goga1.goga1var.mean('Member')
goga2path="/project/cas/islas/savs/python/snowpaper/DATA_SORT/deseasonalized_tvar/TVAR_GOGA2.nc"
goga2 = xr.open_dataset(goga2path)
goga2varm = goga2.goga1var.mean('Member')<jupyter_output><empty_output><jupyter_text>plot the plots<jupyter_code>fig = plt.figure(figsize=(16,16))
ax1 = maps.contourmap_bothcontinents_fill_nh_pos(fig, np.array(best.bestvar), np.array(best.longitude), np.array(best.latitude), 10, -170, 170, '(a) BEST',0.05,0.32,0.8,0.95)
ax2 = maps.contourmap_bothcontinents_scatter_nh_pos(fig, np.array(isd.isdvar), np.array(isd.lon), np.array(isd.lat), 10, -170, 170, '(b) ISD',0.37,0.64,0.8,0.95) 
ax3 = maps.contourmap_bothcontinents_fill_nh_pos(fig, np.array(era5.era5var), np.array(era5.lon), np.array(era5.lat), 10, -170, 170, '(c) ERA5', 0.69,0.97,0.8,0.95)
ax4 = cbars.plotcolorbar(fig, 10, -170, 170,'Temperature variance (K$^{2}$)',0.05+0.2,0.97-0.2,0.765,0.775,posneg='pos', ticks=([0,20,40,60,80,100,120,140,160]), fsize=12)

ax5 = maps.contourmap_bothcontinents_fill_nh_pos(fig, np.array(goga1varm), np.array(goga1varm.lon), np.array(goga1varm.lat), 10, -170, 170, '(d) GOGA1', 0.05, 0.32, 0.55, 0.7)
ax6 = maps.contourmap_bothcontinents_fill_nh_pos(fig, np.array(goga2varm), np.array(goga2varm.lon), np.array(goga2varm.lat), 10, -170, 170, '(e) GOGA2', 0.37, 0.64, 0.55, 0.7)
ax7 = maps.contourmap_bothcontinents_fill_nh_pos(fig, np.array(goga2varm)-np.array(goga1varm), np.array(goga1varm.lon), np.array(goga1varm.lat),
                                                5,-70,70,'(f) GOGA2-GOGA1', 0.69,0.97,0.55,0.7)

ax8 = cbars.plotcolorbar(fig, 10, -170, 170,'Temperature variance (K$^{2}$)',0.05+0.05,0.64-0.05,0.515, 0.525, posneg='pos',ticks=([0,20,40,60,80,100,120,140,160]), fsize=12)
ax9 = cbars.plotcolorbar(fig, 5, -70, 70,'Temperature variance (K$^{2}$)',0.69,0.97,0.515,0.525, ticks=([-60,-40,-20,0,20,40,60]), fsize=12)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16066481994459833, 'fraction_numerical': 0.09172052939365959, 'mean_word_length': 6.080610021786493, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '372532', 'license': 'Apache-2.0', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1390, 'n_words': 207, 'path': 'examples/custom_map_and_colorbars.ipynb', 'repo_name': 'islasimpson/CASanalysis', 'size': '3249'}