Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: graph combine & single legend

From   Oliver Jones <>
Subject   Re: st: RE: graph combine & single legend
Date   Wed, 21 Sep 2011 16:06:59 +0200

I have the same problem as Ricardo.
I tried using the -grc1leg- command, but I can not figure out how to use it.
I always end up with all the legends for every graph and an additional one
from using -grc1leg-.
Thus my questions is: How do I create one single legend?

The code I use is something like this:

************** Beginn example ****************
sysuse xtline1, clear

* Creating two more variable to mimic my data setup
gen cal_yesterday = L.calories
bysort person: gen first_half_year = (_n < 175)

* Draw three scater plots
scatter cal_yesterday calories day if person == 1, ///
	by(first_half_year, title("Tess")) ///
scatter cal_yesterday calories day if person == 2, ///
	by(first_half_year, title("Sam")) ///
scatter cal_yesterday calories day if person == 3, ///
	by(first_half_year, title("Arnold")) ///

* combine the three scatter plots
grc1leg g1 g2 g3
*************** End example *****************

Kind regards

Am 19.09.2011 19:10, schrieb Fiedler, James (JSC-SK)[USRA]:
You might try the user-written command -grc1leg- (since 1's often look like l's, that's "grc" + the numeral 1 + "leg").


From: [] On Behalf Of Ricardo Ovaldia []
Sent: Monday, September 19, 2011 11:19 AM
Subject: st: graph combine&  single legend

I want to combine 4 graphs, each a plot of three lines, using -graph combine-. Because the legend for the graphs are all the same, I would like to have a single legend at the bottom. When I use -legend(off)- for three of the graphs, and leave the legend for the 4th graph, this 4th graph is smaller than the rest when I combine them. Any solutions will be appreciated.

Thank you in advance,

Ricardo Ovaldia, MS
Oklahoma City, OK

*   For searches and help try:

*   For searches and help try:

Universität Bielefeld
Fakultät für Wirtschaftswissenschaften
Lehrstuhl für Ökonometrie und Statistik
- -
Bielefeld University
Faculty of Business Administration and Economics
Chair of Econometrics and Statistics
- -
Raum / room:  V9-110
Tel / phone:  +49 (0)521 106 4871
- -
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index