.. 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_auto_examples_plot_combining_maps.py:
Combining Maps
==============
In this example we'll show how to combine maps in order to get a more detailed
view of Brazil.
A way to plot multiple polygons on top of another is to first plot the more
detailed map, e.g., with states, and then plot on top of it the more aggregated
map, e.g., with macroregions only, with some transparency.
.. code-block:: default
from mapsbr import ibgemaps
states = ibgemaps.get_map("BR", including="states")
macroregions = ibgemaps.get_map("BR", including="macroregions")
ax = states.plot(color="white", edgecolor="gray")
macroregions.plot(color="white", edgecolor="midnightblue", alpha=.5, ax=ax)
ax.axis("off")
.. image:: /auto_examples/images/sphx_glr_plot_combining_maps_001.png
:class: sphx-glr-single-img
.. rst-class:: sphx-glr-script-out
Out:
.. code-block:: none
(-76.25719638750002, -26.577751022500017, -35.70252919050001, 7.2289130005)
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 3.114 seconds)
**Estimated memory usage:** 90 MB
.. _sphx_glr_download_auto_examples_plot_combining_maps.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_combining_maps.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_combining_maps.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_