Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Combined graphs that overlay


From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   st: RE: Combined graphs that overlay
Date   Mon, 8 May 2006 09:42:54 +0100

Although it is not documented (to my knowledge), you can add additional
twoway plots to an existing twoway plot (or something that has been
built with a twoway plot, even if you did not know it at the time, such
as -histogram-) using -graph addplot-. This does not really give you any
more functionality than the -addplot()- option, but you can add the
extra plot(s) later (even adding them to a saved graph) without needing
to start again from scratch, e.g.

sysuse auto
hist price, percent
graph addplot scatter mpg price
graph addplot scatter turn price, legend(on row(1)) ytitle("")

You can also use -graph describe- to obtain the details of named/saved
graphs which can then be recreated in an overlaid  plot (although this
would probably require some care with options in particular).

I can't see any reason why some kind of -graph overlay- subcommand could
not be created for overlaying named/saved twoway plots.

David

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Allan Reese
(Cefas)
Sent: 05 May 2006 12:35
To: [email protected]
Subject: st: Combined graphs that overlay

I've tried a couple of times to overlay different types of graph, and
not come up with a satisfactory solution.  The low level commands of
Stata 7 could be programmed to do this, but "graph combine" allows only
for graphs to butt against each other.  One example would be to place
pies or barcharts at X-Y positions to make a simple map.

a) Is there an obvious solution I've overlooked?

b) Do other users see a general need?

c) Could it be implemented as an option to combine? Maybe: at(graphno r
c xscale yscale) where r and c refer to absolute position in the
plotting area (see help gph).  Eg

graph combine gr1 gr2 gr3, at(1 23063 0 .5 1) at(2 23063 16001 .5 1)
at(3 11531 20001 .1 .1)

Allan

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

*
*   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/



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