How can I add basemaps to a seaborn jointplot?

267 Views Asked by At

Can someone guide me on how best to add a background map to two seaborn jointplots I created?

To give context, I am currently analyzing a dataset from Austin Police Dept's Crime Reports database. What I am attempting to do is visualize the density of murders and capital murders in Austin, TX. The dataset extends from the beginning of 2003 to the present.

The notebook can be located at: https://github.com/rgrantham82/Hate_Crimes_Analysis/blob/master/Austin%20Crimes%20Report%20Analysis.ipynb

So far, I visualized both data frames using the seaborn jointplot method, using latitude and longitude.

I BELIEVE this is a good method to plot the density of murders judging by the dataset but if someone has a better idea, I am open to instruction on that as well.

So, if it is even possible, how do I add a basemap to both plots?

So far, I attempted the contextily method and the geopandas method. Admittedly, this is my first attempt (outside of DataCamp class) using either method. As of to date, I am unsuccessful with both.

The contextily addbasemap() method did not produce a map (I guess it does not have one for the Austin area?). And also with the geopandas method I could not get it to work in producing a viable basemap either. I seem to be simply swamped by it.

Murders Plot Capital Murders Plot

0

There are 0 best solutions below