Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: Problem with graph


From   Amal Khanolkar <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Problem with graph
Date   Fri, 23 Aug 2013 13:01:25 +0000

Dear Joerg & David,

Thanks for the tips and help! Got my graph to work :)

Unfortunately the book isn't free online.

Using the same code below, how would I include a single line for the mean value of each curve (that is a line that drops down onto the x-axis). I wasn't able to find anything in the help file for twoway graphs.

kdensity grdbs if ethnicgraph==1 , generate(x_sweden y_sweden)
kdensity grdbs if ethnicgraph==2 , generate(x_arab y_arab)
kdensity grdbs if ethnicgraph==3 , generate(x_som y_som)
kdensity grdbs if ethnicgraph==4 , generate(x_sasia y_sasia)
kdensity grdbs if ethnicgraph==5 , generate(x_ethiop y_ethiop)
kdensity grdbs if ethnicgraph==6 , generate(x_easia y_easia)
kdensity grdbs if ethnicgraph==7 , generate(x_africa y_africa)


twoway (line y_sweden x_sweden, sort) ///
	   (line y_arab x_arab, sort) ///
	   (line y_som x_som, sort) ///
	   (line y_sasia x_sasia, sort) ///
	   (line y_ethiop x_ethiop, sort) ///
       (line y_easia x_easia, sort) ///
       (line y_africa x_africa, sort) ///
   ,   legend(order(1 "Sweden" 2 "Arab" 3 "Somalia" 4 "SouthAsia" 5 "Ethiopia" 6 "EastAsia" 7 "Africa"))
   


Cheers,

/Amal.
________________________________________
From: [email protected] [[email protected]] on behalf of Radwin, David [[email protected]]
Sent: 22 August 2013 18:41
To: [email protected]
Subject: RE: st: Problem with graph

Amal,

Also, an excellent reference for graphics is "A visual guide to Stata
graphics, Third Edition" by Michael N. Mitchell (2012).
http://www.stata.com/bookstore/visual-guide-to-stata-graphics/index.html

David
--
David Radwin
Senior Research Associate
Education Studies Division
RTI International
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-665-8274

www.rti.org


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Joerg Luedicke
> Sent: Thursday, August 22, 2013 9:13 AM
> To: [email protected]
> Subject: Re: st: Problem with graph
>
> On Thu, Aug 22, 2013 at 11:51 AM, Amal Khanolkar
<[email protected]>
> wrote:
> <snip>
> >
> > - I get the plot I need with 7 curves - which looks very good - but
for
> some reason Stata only specifies the legend (colour) for the first two
> categories (sweden and arab, but not the rest). Could anyone tell me
why?
>
> The integer numbers in the legend option should refer to the order of
> plots, _not_ to values in your variable -ethnicity2-. Try the
> following instead:
>
> legend(order(1 "Sweden" 2 "Arab" 3 "Somalia" 4 "SouthAsia" 5
> "Ethiopia" 6 "EastAsia" 7 "Africa"))
>
> BTW, you could also use -twoway kdensity- directly.
>
> >
> > - Also, how do I know the default pattern (and order of colours used
by
> Stata?
>
> see -help connect_options-, especially -lpattern()- and -lcolor()-
>
> Joerg

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

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index