Statalist


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

Re: st: programming graphs in stata


From   n j cox <[email protected]>
To   [email protected]
Subject   Re: st: programming graphs in stata
Date   Tue, 16 Oct 2007 21:15:55 +0100

Programming graphs in Stata is just programming with -graph-
in Stata, as from Stata 8. Perhaps Matthias has been focusing
on other software, or in some Rip Van Winkle state, in the
interim.

Matthias asks about -gph-. -gph- is still there and it would
have one possible advantage over -graph- (speed), but I can
think of absolutely no other reason to use it. While
-gph- was visible it was slightly popular for some graphics
programming, because it gave you total control, but as soon as
Stata 8 came out I believe that everyone who had been using -gph- abandoned it without regret, because you needed to re-create
everything (even axis ticks, axis labels, etc.).

With -graph-, my own experience is that almost all graphics
programming calls for -twoway- calls. This applies even --
indeed especially -- if your graph doesn't possess x and
y axes. You still use -twoway- and then suppress the axes.

On spineplots, snap! I've picked up my pen, or rather opened
up Stata, to think about writing a spineplot program about
three times, and got no further than thinking a little
about strategy. The crucial detail appears to be is that
-twoway bar- doesn't let you vary bar width. Thus you
would, so far as I can see, need to superimpose as many
distinct -twoway bar-s as there were distinct bar widths,
and probably more (because you might want some that were
otherwise different). That sounds like a bad idea. Thus
I am led to surmise that you would be better off, for any
program with pretensions to generality, with something like
-twoway area-. It must be possible, but it doesn't
sound quite trivial, unless I'm missing some trick.

I hope you make progress on the idea. Spine plots are the
acceptable face of mosaic plots, in my view.

Nick
[email protected]

Schonlau, Matthias

For programming new graphs in stata, Stata 7 offered the command "gph".
This is still available under version control, but I believe the use of
gph at this point is discouraged. (Right?)

I am particularly interested in creating spine plots. These are plots
similar to barcharts, but with the width proportional to frequency (and
constant height). Barcharts work just the other way around.

What options do I have to program new graphs?

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