# RE: st: problem with graphs by() option.

 From "David Harrison" To Subject RE: st: problem with graphs by() option. Date Fri, 11 Feb 2005 08:50:33 -0000

An -l2title- for the entire graph can be given as an option to -by()-. Note that this will be to the left of the -ytitle- so you may want to swap the text between the two, e.g.

. sysuse auto
. scatter price mpg , by(fore, l2title(Price)) ytitle(US Dollar, si(small))

You can also just give two lines to the ytitle, e.g.

. scatter price mpg , by(fore) ytitle("Price" "US Dollar")

David
david@icnarc.org

-----Original Message-----
From: smerryman@kc.rr.com [mailto:smerryman@kc.rr.com]
Sent: 10 February 2005 20:12
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: problem with graphs by() option.

Ricardo,

Though not identical to something like:

. sysuse auto
. scatter price mpg , by(fore) ytitle(Price) l2title(US Dollar)

drawing each graph separately and then combining them is close:

. scatter price mpg if for == 1, subtitle("Domestic", box bex) ///
l2title(Price) ytitle(US Dollars) saving(graph1, replace) nodraw

. scatter price mpg if for == 1, subtitle("Foreign", box bex) ///
ytitle("")  ylabel(,  noticks nolabels) saving(graph2, replace) nodraw

. graph combine "graph1.gph" "graph2.gph", ycommon xcommon

Scott

----- Original Message -----
From: Ricardo Ovaldia <ovaldia@yahoo.com>
Date: Thursday, February 10, 2005 11:08 am
Subject: st: problem with graphs by() option.

> Dear all,
>
> I have created a graph with two side-by-side plots. I
> used the ytitle and the -l2title()- to place two
> titles on the y-axis. The problem is that the second
> title, the one from -l2title()-, appears on both
> plots. I would like to supress this title from the
> second graph. That is, I only want titles on the left
> yaxis of the first (left) plot.
>
> Thank you,
> Ricardo.
>

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/