Announcement

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

  • Stata blank legend for buffer

    Is it possible to create an invisible legend in Stata?

    I am using `graph combine` in Stata to present two graphs side by side and one needs a legend and the other does not. Is it possible to take the legend from graph 2 and insert it in graph 1 so they are the same size? I do not want a legend to show in graph 1, just the spacing.

    I started with the legend help file but this does not seem to be an option.

  • #2
    I think it will be too much work to accomplish that. I would instead recommend installing grc1leg by Vince Wiggins and specifying that the legend be taken from the second graph.

    Code:
    net install grc1leg, from (http://www.stata.com/users/vwiggins)
    grc1leg graph1 graph2, legendfrom(graph2)

    Comment


    • #3
      Thanks, Andrew. The issue is that what I displaying in graph 1 is a line for a whole state and then graph 2 is individual lines for each city. I do not want people to think that graph 1 has any legend but since they both have the same X and Y axis, I want them to be the same size.

      Comment


      • #4
        You may find the grc1leg2 command, based on grc1leg but with added options, to be useful.
        Code:
        net install grc1leg2.pkg, from (http://digital.cgdev.org/doc/stata/MO/Misc/)
        I will note however that both commands have problems with graphs created using the by() option: see this link for details and a hack to work around the problem if it pertains to what you are doing.

        https://www.statalist.org/forums/for...pear-graphs-by

        Comment


        • #5
          Thanks, Andrew. The issue is that what I displaying in graph 1 is a line for a whole state and then graph 2 is individual lines for each city. I do not want people to think that graph 1 has any legend but since they both have the same X and Y axis, I want them to be the same size.
          See https://www.statalist.org/forums/for...ferent-legends for some technique. You want to choose a scheme with a white background (e.g., s1color) and remove the border of the legend. I cannot help more without a reproducible example.

          Comment

          Working...
          X