.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_nyc_collisions_quadtree.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_nyc_collisions_quadtree.py: Quadtree of NYC traffic collisions ================================== This example plots traffic collisions in New York City. Overlaying a ``pointplot`` on a ``quadtree`` like this communicates information on two visual channels, position and texture, simultaneously. .. GENERATED FROM PYTHON SOURCE LINES 9-27 .. image:: /gallery/images/sphx_glr_plot_nyc_collisions_quadtree_001.png :alt: New York Ciy Traffic Collisions, 2016 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none /Users/alekseybilogur/opt/miniconda3/envs/geoplot-dev/lib/python3.8/site-packages/geopandas/geoseries.py:644: UserWarning: GeoSeries.isna() previously returned True for both missing (None) and empty geometries. Now, it only returns True for missing values. Since the calling GeoSeries contains empty geometries, the result has changed compared to previous versions of GeoPandas. Given a GeoSeries 's', you can use 's.is_empty | s.isna()' to get back the old behaviour. To further ignore this warning, you can do: import warnings; warnings.filterwarnings('ignore', 'GeoSeries.isna', UserWarning) return self.isna() Text(0.5, 1.0, 'New York Ciy Traffic Collisions, 2016') | .. code-block:: default import geopandas as gpd import geoplot as gplt import geoplot.crs as gcrs import matplotlib.pyplot as plt nyc_boroughs = gpd.read_file(gplt.datasets.get_path('nyc_boroughs')) collisions = gpd.read_file(gplt.datasets.get_path('nyc_collision_factors')) ax = gplt.quadtree( collisions, nmax=1, projection=gcrs.AlbersEqualArea(), clip=nyc_boroughs, facecolor='lightgray', edgecolor='white', zorder=0 ) gplt.pointplot(collisions, s=1, ax=ax) plt.title("New York Ciy Traffic Collisions, 2016") .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 12.958 seconds) .. _sphx_glr_download_gallery_plot_nyc_collisions_quadtree.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_nyc_collisions_quadtree.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_nyc_collisions_quadtree.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_