Statalist


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

Re: st: RE: row and column titles for graphs with the by option


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: row and column titles for graphs with the by option
Date   Wed, 21 Oct 2009 15:24:02 -0700 (PDT)

---- Maarten buis wrote:
> Does anyone know a trick to create the following graph?
> Start with the graph in the example below. 
> 
> *--------------- begin example ----------------
> sysuse auto, clear
> recode rep78 1/2=3
> label define rep78 3 "average" 4 "good" 5 "excelent"
> label value rep78 rep78
> scatter price mpg , by(foreign rep78) name(rowcol,
> replace)
> *---------------- end example -----------------
> 
> Notice that there is quite a bit of redundancy in the
> information contained in the graph titles. So I was
> thinking of a graph where the columns where labeled on
> the top as "average", "good", "excelent", and the rows
> where labeled on the right as "domestic", and "foreign". 
> 
> The example below shows how to create those "column
> titles", but I am struggling with "row titles".
> 
> *----------------- begin example ---------------------
> sysuse auto, clear
> recode rep78 1/2=3
> egen byvar = group(foreign rep78)
> label define byvar 1 "average" 2 "good" 3 "excelent" ///
>                
>    4 " " 5 " " 6 " "
> label value byvar byvar
> scatter price mpg , by(byvar) name(col, replace)
> *------------------ end example -----------------------


--- On Wed, 21/10/09, Martin Weiss answered:
> Use the graph editor with the textboxes and spin them to
> vertical orientation, apply the "bluish-gray" background.
> Record the whole thing for convenient playback...

Thanks, that is indeed one possible answer to my question, but 
that won't work in an .ado file. To be fair, I did not state in 
my question that that was my aim. 

To be more concrete: Consider Figures 6.9 and 6.10 of 
http://www.maartenbuis.nl/dissertation/chap_6.pdf . These are
created using a program I wrote -seqlogitdecomp-, which is 
part of the -seqlogit- package which can be downloaded from
SSC. Now the rows are labeled using different colors/grays in
combination with a legend. The aim is to update this package
so that the rows are labeled on the right rather than in a 
legend. 

-- Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------



Send instant messages to your online friends http://uk.messenger.yahoo.com 

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index