.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_09_effects.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_09_effects.py: Drop shadow and glow ===================== ``box_shadow`` and ``glow`` apply to the main map, either with the default settings (``True``) or through a dict (``dx``, ``dy``, ``blur``, ``color``, ``opacity``). Here an outer glow on a dark background, over a European basemap. .. GENERATED FROM PYTHON SOURCE LINES 10-53 .. raw:: html Guadeloupe Martinique French Guiana Reunion Mayotte Outer glow on a dark background .. code-block:: Python from mappyng import Map, BasemapLayer, VectorLayer from mappyng.data import load_france_departments, load_europe europe = load_europe().to_crs(2154) deps = load_france_departments().to_crs(2154) bbox_metro = [90000, 6040000, 1280000, 7150000] cartouches = { 0: {"bbox": [-6890454, 1780151, -6799589, 1874186], "crs": 3857, "cartouche_title": "Guadeloupe", "cartouche_title_size": 7, "border_radius": 6, "glow": {"blur": 8, "color": "#4cc9f0"}}, 1: {"bbox": [-6826862, 1609607, -6759494, 1685367], "crs": 3857, "cartouche_title": "Martinique", "cartouche_title_size": 7, "border_radius": 6, "glow": {"blur": 8, "color": "#4cc9f0"}}, 2: {"bbox": [-6136680, 235261, -5707791, 671780], "crs": 3857, "cartouche_title": "French Guiana", "cartouche_title_size": 7, "border_radius": 6, "glow": {"blur": 8, "color": "#4cc9f0"}}, 3: {"bbox": [6136383, -2448160, 6226316, -2366992], "crs": 3857, "cartouche_title": "Reunion", "cartouche_title_size": 7, "border_radius": 6, "glow": {"blur": 8, "color": "#4cc9f0"}}, 4: {"bbox": [5006226, -1459183, 5050208, -1416184], "crs": 3857, "cartouche_title": "Mayotte", "cartouche_title_size": 7, "border_radius": 6, "glow": {"blur": 8, "color": "#4cc9f0"}}, } m = Map( europe, bbox=bbox_metro, width=900, height=1000, padding=25, style={"base": "classic", "title_color": "#e0e1dd"}, facecolor="#16324a", background="#0d1b2a", border_radius=10, glow={"blur": 14, "color": "#4cc9f0", "opacity": 0.7}, cartouche_params=cartouches, cartouche_spacing=15, ) m.add(BasemapLayer()) m.add_shadow(europe, {"query": "code_pays_iso3=='FRA'", "on_cartouches": True}) m.add(VectorLayer(deps, stroke="#4cc9f0", stroke_width=0.2, on_cartouches=True)) m.title("Outer glow on a dark background") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.233 seconds) .. _sphx_glr_download_gallery_plot_09_effects.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_09_effects.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_09_effects.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_09_effects.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_