title: Displaying two horizontal colorbars on this precipitation map leading to large white spaces
body: <p>I am working on making a nice precipitation map using Metpy. I think this is more of a matplotlib question, but I am stumped on how to add two horizontal colorbars onto this figure. The overall idea is to have snow and rain rates shown on this map which I have accomplished by utilizing two contour fills onto one figure. I want to show two colorbars since I have two separate rates for the snow rates vs the rain rates. Ideally, I want the two colorbars side by side horizontally. The closest I have gotten is to have them stacked with a large space between them. Here is my sloppy code.</p>
  <pre><code>import metpy
  from siphon.catalog import TDSCatalog
  from datetime import datetime, timedelta
  %matplotlib inline
  import cartopy.crs as ccrs
  import cartopy.feature as cfeature
  from metpy.units import units
  import metpy.calc as mpcalc
  import matplotlib.pyplot as plt
  import matplotlib.colors as cls
  from xarray.backends import NetCDF4DataStore
  import xarray as xr
  from scipy.ndimage import gaussian_filter
  import numpy as np
  
  # Set up access via NCSS
  gfs_catalog = ('http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/'
                'Global_0p5deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p5deg/Best')
  cat = TDSCatalog(gfs_catalog)
  ncss = cat.datasets[0].subset()
  query3 = ncss.query()
  query3.accept('netcdf')
  query3.variables('Pressure_reduced_to_MSL_msl', 'Precipitation_rate_surface', 'Snow_depth_surface', 'Categorical_Snow_surface')
  now = datetime.utcnow()
  query3.time_range(now, now + timedelta(days=4))
  query3.lonlat_box(west=-140, east=-60, north=60, south=20)
  data3 = ncss.get_data(query3)
  ds3 = xr.open_dataset(NetCDF4DataStore(data3))
  
  #parsing data
  isSnow_var = ds3.metpy.parse_cf('Categorical_Snow_surface')
  precip_var = ds3.metpy.parse_cf('Precipitation_rate_surface')
  longitude = precip_var.metpy.x
  latitude = precip_var.metpy.y
  time_index = 11
  
  #All the Precip Stuff
  precip_inch_hour = precip_var[time_index].squeeze() *  141.73228346457 
  precip2 = mpcalc.smooth_n_point(precip_inch_hour, 5, 1)
  
  #Converting to 10:1 snow ratio
  snow_precip = (precip_inch_hour * isSnow_var[time_index].squeeze()) * 10
  
  # Plot using CartoPy and Matplotlib
  mapproj = ccrs.LambertConformal(central_latitude=45., central_longitude=-100.)
  
  # Set projection of data
  data_projection = ccrs.PlateCarree()
  
  # Grab data for plotting state boundaries
  states_provinces = cfeature.NaturalEarthFeature(
         category='cultural',
         name='admin_1_states_provinces_lakes',
         scale='50m',
         facecolor='none')
  
  # Set extent and plot map lines
  fig = plt.figure(1, figsize=(25.,25.))
  ax = plt.subplot(111, projection=mapproj)
  ax.set_extent([-125., -70, 25., 50.], ccrs.PlateCarree())
  ax.coastlines('50m', edgecolor='black', linewidth=0.75)
  ax.add_feature(states_provinces, edgecolor='black', linewidth=0.5)
  
  #colormap data
  precip_colors = [
     &quot;#bde9bf&quot;,  # 0.01 - 0.02 inches 1
     &quot;#adddb0&quot;,  # 0.02 - 0.03 inches 2
     &quot;#9ed0a0&quot;,  # 0.03 - 0.04 inches 3
     &quot;#8ec491&quot;,  # 0.04 - 0.05 inches 4
     &quot;#7fb882&quot;,  # 0.05 - 0.06 inches 5
     &quot;#70ac74&quot;,  # 0.06 - 0.07 inches 6
     &quot;#60a065&quot;,  # 0.07 - 0.08 inches 7
     &quot;#519457&quot;,  # 0.08 - 0.09 inches 8
     &quot;#418849&quot;,  # 0.09 - 0.10 inches 9
     &quot;#307c3c&quot;,  # 0.10 - 0.12 inches 10
     &quot;#1c712e&quot;,  # 0.12 - 0.14 inches 11
     &quot;#f7f370&quot;,  # 0.14 - 0.16 inches 12
     &quot;#fbdf65&quot;,  # 0.16 - 0.18 inches 13
     &quot;#fecb5a&quot;,  # 0.18 - 0.2 inches 14
     &quot;#ffb650&quot;,  # 0.2 - 0.3 inches 15
     &quot;#ffa146&quot;,  # 0.3 - 0.4 inches 16
     &quot;#ff8b3c&quot;,   # 0.4 - 0.5 inches 17
     &quot;#ff8b3c&quot;   # 0.5 - 0.6 inches 18
  ]
  
  precip_colormap = cls.ListedColormap(precip_colors)
  
  #Precip Rate
  clev_precip =  np.concatenate((np.arange(0.01, 0.1, .01), np.arange(.1, .2, .02), np.arange(.2, .61, .1)))
  norm = cls.BoundaryNorm(clev_precip, 18)
  cf = ax.contourf(longitude, latitude, precip2, clev_precip, cmap=precip_colormap, norm=norm, transform=ccrs.PlateCarree())
  cb = plt.colorbar(cf, ticks=clev_precip, aspect=65, orientation = 'horizontal', shrink=0.6, pad=0.01)
  
  snow_colors = [
     &quot;#63c9d5&quot;,  # 0.1 - 0.2 inches 1
     &quot;#5fb4ca&quot;,  # 0.2 - 0.3 inches 2
     &quot;#5a9fc0&quot;,  # 0.3 - 0.4 inches 3
     &quot;#558ab5&quot;,  # 0.4 - 0.5 inches 4
     &quot;#4e76aa&quot;,  # 0.5 - 0.6 inches 5
     &quot;#4763a0&quot;,  # 0.6 - 0.7 inches 6
     &quot;#3e4f95&quot;,  # 0.7 - 0.8 inches 7
     &quot;#353c8b&quot;,  # 0.8 - 0.9 inches 8
     &quot;#292980&quot;,  # 0.9 - 1.0 inches 9
     &quot;#493387&quot;,  # 1.0 - 1.2 inches 10
     &quot;#643e8e&quot;,  # 1.2 - 1.4 inches 11
     &quot;#7c4995&quot;,  # 1.4 - 1.6 inches 12
     &quot;#94559c&quot;,  # 1.6 - 0.18 inches 13
     &quot;#ab61a3&quot;,  # 1.8 - 2 inches 14
     &quot;#c36eaa&quot;,  # 2 - 3 inches 15
     &quot;#da7bb0&quot;,  # 3 - 4 inches 16
     &quot;#f288b7&quot;   # 4 - 5 inches 17
  ]
  
  snow_colormap = cls.ListedColormap(snow_colors)
  
  #Snow Rate
  clev_snow =  np.concatenate((np.arange(.1, 1, .1), np.arange(1, 2, .2), np.arange(2, 6, 1)))
  norm2 = cls.BoundaryNorm(clev_snow, 17)
  cf2 = ax.contourf(longitude, latitude, snow_precip, clev_snow, cmap=snow_colormap, norm=norm2, transform=ccrs.PlateCarree())
  cb2 = plt.colorbar(cf2, ticks=clev_snow, orientation = 'horizontal', pad=0.01, shrink=0.6, aspect=65)
  
  #Valid Time
  vtime = isSnow_var.metpy.time[time_index].values
  
  #Title Info
  plt.title('MSLP (hPa) with Highs and Lows, 1000-500 hPa Thickness (m), Rain (in/hr), Snow 10:1 (in/hr)', loc='left')
  plt.title(f'VALID: {vtime}', loc='right')
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/xeYIO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xeYIO.jpg" alt="Example of Plot" /></a></p>
  <p>I've tried subplots and I've tried gridSpec but I keep hitting different roadblocks, getting different errors when I try those different methods. Mainly I think it has to do with my entry level knowledge with Metpy, Cartopy, and Matplotlib. Apprecaite any insight and possible solution to this issue. Thanks!</p>