Bubble Plot

The bubble plot function returns a Plotly scatter plot layered ontop of a map. The color of the markers will indicate the number of detections at each location. Alternatively, you can indicate the number of individuals seen at each location by using type = 'individual'.

Warning

Input files must include station , catalognumber, unqdetecid, latitude, longitude, and datecollected as columns.

To display the plot in iPython use:

Or use the standard plotting function to save as HTML:

You can also do your count by number of individuals by using type = 'individual:


Mapbox

Alternatively you can use a Mapbox access token plot your map. Mapbox is much for responsive than standard Scattergeo plot.

Example Code

Below is the sample output for blue sharks off of the coast of Nova Scotia.


Bubble Plot Function

bubble_plot.bubble_plot(detections, type='detections', ipython_display=True, title='Bubble Plot', height=700, width=1000, plotly_geo=None, filename=None, mapbox_token=None, marker_size=10, colorscale='Viridis')

Creates a plotly abacus plot from a pandas dataframe

Parameters:
  • detections – detection dataframe
  • ipython_display – a boolean to show in a notebook
  • title – the title of the plot
  • height – the height of the plotl
  • width – the width of the plotly
  • plotly_geo – an optional dictionary to controle the geographix aspects of the plot
  • filename – Plotly filename to write to
  • mapbox_token – A string of mapbox access token
  • marker_size – An int to indicate the diameter in pixels
  • colorscale – A string to indicate the color index
Returns:

A plotly geoscatter plot or mapbox plot