# How to plot Domain?

**URL:** <https://forum.cmascenter.org/t/how-to-plot-domain/2616>\
**Category:** CMAQ\
**Tags:** cmaq\
**Created:** [August 25, 2021, 7:45pm UTC](https://forum.cmascenter.org/t/how-to-plot-domain/2616 "2021-08-25T19:45:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)\
**Post date:** [August 25, 2021, 7:45pm UTC](https://forum.cmascenter.org/t/how-to-plot-domain/2616/1 "2021-08-25T19:45:15Z")

</div>

Hello,

Let’s say I have modeling domain information as following:

!— Map projection parameters —

Map\_Projection = ‘LAMBERT’, ! (LAMBERT,POLAR,UTM,LATLON)  
UTM\_Zone = 0,  
Longitude\_Pole = -97., ! deg (west\<0,south\<0)  
Latitude\_Pole = 40., ! deg (west\<0,south\<0)  
True\_Latitude1 = 33., ! deg (west\<0,south\<0)  
True\_Latitude2 = 45., ! deg (west\<0,south\<0)

!— Parameters for the master (first) grid —

Number\_of\_Grids = $ngrid,  
Master\_SW\_XCoord = -2952., ! km or deg, SW corner of cell(1,1)  
Master\_SW\_YCoord = -2772., ! km or deg, SW corner of cell (1,1)  
Master\_Cell\_XSize = 36., ! km or deg  
Master\_Cell\_YSize = 36., ! km or deg  
Master\_Grid\_Columns = 172,  
Master\_Grid\_Rows = 148,  
Number\_of\_Layers = 35,

!— Parameters for the 12km grid —

Nest\_Meshing\_Factor(2) = 3, ! Cell size relative to master grid  
Nest\_Beg\_I\_Index(2) = 16, ! Relative to master grid  
Nest\_End\_I\_Index(2) = 147, ! Relative to master grid  
Nest\_Beg\_J\_Index(2) = 33, ! Relative to master grid  
Nest\_End\_J\_Index(2) = 114, ! Relative to master grid

How can I plot these domains/grids? What tool to use?. Basically, I want to see my plot as similar to following plot ![plt.PNG](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/0/080be1bb45dff81d8c3d28b108e07aa989a7fc53.jpeg)

---

<div class="post-metadata">

**Author:** ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)\
**Post date:** [August 26, 2021, 12:14pm UTC](https://forum.cmascenter.org/t/how-to-plot-domain/2616/2 "2021-08-26T12:14:37Z")

</div>

Those plots may have been created using R with its maps package – though you would also need an additional package containing data describing boundaries of the Mexican states and Canadian provinces, if you want those included.

If you really want to know how that figure was generated, I would try to contact whoever created the figure! If it is from a paper, you can contact the corresponding author. If it is from an EPA website, there ought to be a way to send a similar inquiry.

Coincidentally, I have a paper [in press](https://doi.org/10.1080/10962247.2021.1970048) at the Journal of the Air & Waste Management Association, and Figure 1 of that paper is similar. The code used to make all the figures is included with the dataset for that paper, which should be available soon after the paper is published. If that figure is of interest but you can’t wait for the dataset to be published, contact me by email.

---

<div class="post-metadata">

**Author:** ![barronh](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@barronh](https://forum.cmascenter.org/u/barronh)\
**Post date:** [August 26, 2021, 1:16pm UTC](https://forum.cmascenter.org/t/how-to-plot-domain/2616/3 "2021-08-26T13:16:26Z")

</div>

The link below will take you to a Jupyter Notebook that makes a final product below. It does not annotate the lines as shown in your example, but you can add that easily using `plt.annotate`. The notebook can be run in the cloud or on your own machine. This is easy to update to accommodate other grids, and projections (e.g., polar stereographic).

![image](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/3/31b2881fd05b0dfe78d162e00a12f862946fa0ae.png)

p.s., I’m not sure the preview from this site will look right. Just follow the link.

> <https://gist.github.com/barronh/41fccc69da11265c64ba9d59dc6ab6eb>
