Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Output

    Hi All,
    I am creating a map in stata and did this in a loop since I will be creating many of them. However each map is being replaced by the next one that runs from the loop. Any idea how I can have all the maps appearing without replacing each other will be greatly appreciated.
    Below is the command of my loop

    foreach var in p1 p2 p3 p4 p5 p6 p7 p8 p9 p10{
    2. spmap `var' using uscoord if cid !=., id(id) fcolor(Blues)
    3. }


    Thanks,
    Francis

  • #2
    I believe saving() under the Graph options of spmap would help. That way, you save each map and move to the next.

    Comment


    • #3
      In help spmap we see "graph options"; scrolling down to that section we see that included in those are "twoway options"; clicking on twoway options shows us the name option for assigning a name to the graph. Clicking on that takes us to help name_option that explains that each graph has a default name and replaces the previous one by that name in the graph window. By assigning graphs distinct names, the Graph window can display multiple graphs.

      Something like this may work for you.
      Code:
      spmap `var' using uscoord if cid !=., id(id) fcolor(Blues) name(`var',replace)

      Comment

      Working...
      X