.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/map_plots/custom_map_domain.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_examples_map_plots_custom_map_domain.py: Create a custom map domain -------------------------- EMCPy's map domain includes a feature to create a custom dictionary with specified lat and lon inputs to create a specific map domain. This is helpful for users who want to look at a specific domain that is not included in EMCPy. .. GENERATED FROM PYTHON SOURCE LINES 11-51 .. image-sg:: /examples/map_plots/images/sphx_glr_custom_map_domain_001.png :alt: Custom Africa Domain :srcset: /examples/map_plots/images/sphx_glr_custom_map_domain_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from emcpy.plots import CreatePlot, CreateFigure from emcpy.plots.map_tools import Domain, MapProjection def main(): # Create dictionary with information pertaining to # Africa domain africa_dict = { "extent": (-20, 55, -35, 35), "xticks": (-15, 0, 15, 30, 45), "yticks": (-30, -15, 0, 15, 30), "cenlon": 20., "cenlat": -10. } # Create plot object and add features plot1 = CreatePlot() plot1.projection = 'plcarr' # Add data as a tuple with 'custom' as domain name # and `africa_dict` as dictionary plot1.domain = ('custom', africa_dict) plot1.add_map_features(['coastline']) plot1.add_xlabel(xlabel='longitude') plot1.add_ylabel(ylabel='latitude') plot1.add_title(label='Custom Africa Domain', loc='center', fontsize=12) fig = CreateFigure() fig.plot_list = [plot1] fig.create_figure() plt.show() if __name__ == '__main__': main() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.060 seconds) .. _sphx_glr_download_examples_map_plots_custom_map_domain.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: custom_map_domain.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: custom_map_domain.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_