.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_melbourne_schools.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_melbourne_schools.py: Voronoi of Melbourne primary schools ==================================== This example shows a ``pointplot`` combined with a ``voronoi`` mapping primary schools in Melbourne. Schools in outlying, less densely populated areas serve larger zones than those in central Melbourne. This example inspired by the `Melbourne Schools Zones Webmap `_. .. GENERATED FROM PYTHON SOURCE LINES 11-29 .. image:: /gallery/images/sphx_glr_plot_melbourne_schools_001.png :alt: Primary Schools in Greater Melbourne, 2018 :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Text(0.5, 1.0, 'Primary Schools in Greater Melbourne, 2018') | .. code-block:: default import geopandas as gpd import geoplot as gplt import geoplot.crs as gcrs import matplotlib.pyplot as plt melbourne = gpd.read_file(gplt.datasets.get_path('melbourne')) melbourne_primary_schools = gpd.read_file(gplt.datasets.get_path('melbourne_schools'))\ .query('School_Type == "Primary"') ax = gplt.voronoi( melbourne_primary_schools, clip=melbourne, linewidth=0.5, edgecolor='white', projection=gcrs.Mercator() ) gplt.polyplot(melbourne, edgecolor='None', facecolor='lightgray', ax=ax) gplt.pointplot(melbourne_primary_schools, color='black', ax=ax, s=1, extent=melbourne.total_bounds) plt.title('Primary Schools in Greater Melbourne, 2018') .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 5.831 seconds) .. _sphx_glr_download_gallery_plot_melbourne_schools.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_melbourne_schools.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_melbourne_schools.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_