title: Trying to add a colorbar to a Seaborn scatterplot
body: <p>I'm a geology master's student working on my dissertation with a focus on the Sulfur Dioxide output of a number of volcanoes in the South Pacific. I have a little experience with R but my supervisor recommended python (JupyterLab specifically) for generating figures and data manipulation so I'm pretty new to programming and essentially teaching myself as I go. I'm trying to use earthquake data to generate some scatterplots using seaborn but I can't seem to get a color bar to show up in the legend for the earthquake magnitude. The code I'm using is below and I'll do my best to format it in a clear way.</p>
  <pre><code>import pandas as pd
  import numpy as np
  import seaborn as sns
  import matplotlib.pyplot as plt
  import matplotlib as mpl
  from scipy import stats
  import cartopy.crs as ccrs
  import cartopy.io.img_tiles as cimgt
  </code></pre>
  <p>then the data sets I'm working with. These are the sets for Earthquake data.</p>
  <pre><code>df = pd.read_csv('Vanuatu Earthquakes May18-May19.csv')
  df = pd.read_csv('Vanuatu Earthquakes May17-May18.csv')
  df = pd.read_csv('Vanuatu Earthquakes May19-Jul20.csv')
  </code></pre>
  <p>and locations of the volcanoes, purely there for spatial reference.</p>
  <pre><code>dg = pd.read_csv('Volcano coordinates.csv')
  </code></pre>
  <p>Here's the main plot I'm trying to work with as it stands at the moment. So far I've been able to classify the earthquakes' magnitudes using the hue function but I don't like how it looks in the legend and want to convert it to a colorbar (or use a colorbar instead of hue, either/or), except I can't quite figure out how to do that. Alternatively, if there's a different function that would give me the results I'm looking for, I'm definitely open to that instead of a scatterplot. Also the black triangles are the volcanoes so those can be ignored for now.</p>
  <pre><code>plt.figure(figsize=(5.5,9))
  sns.scatterplot(x='longitude', y='latitude', data=df, 
                  marker='D', hue='mag', palette='colorblind', cmap='RdBu')
  sns.scatterplot(x='longitude', y='latitude', data=dg, 
                  marker='^', legend='brief', color='k', s=100)
  plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0., title='Magnitude (Mw)')
  plt.xlabel('Longitude (degrees)')
  plt.ylabel('Latitude (degrees)')
  plt.title('Earthquake and Volcano Locations', size=15)
  plt.show()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/TjOYA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TjOYA.png" alt="image" /></a></p>
  <p>Hopefully that's clear enough but let me know if more info is needed!</p>