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: drawing lines to points outside the specified range of plot


From   [email protected]
To   [email protected]
Subject   Re: st: drawing lines to points outside the specified range of plot
Date   Wed, 30 Mar 2011 21:11:20 +0200

Thanks a lot for the suggestions, however, I think I have not been clear enough
in what my problem is so I'll try again;

My goal is making plots like these:

http://www.escholarship.org/uc/item/3b06127p?display=all#page-6

(The paper gives R code which I'm trying to adapt for Mata)

All the shown plots have (roughly)  x-range(-2,2) y-range (-2,2.5)
The red lines are drawn by connecting paired coordinates. However, some
coordinates/points are way outside the plot region (for example (-100,100)),
where the lines project towards, while at the same time constraining the
plotsize/axis-range to the same size. However this I can not manage in Stata:
either the range has to be extended or the line is not drawn. So, as an simple
example:

twoway pci 1 1 30 30, xsc(r(0 50))

can't be changed to

twoway pci 1 1 30 30, xsc(r(0 5))

since it then sets the range of the xsc to (0 30) automatically, which is
normally the most logical of course.

I hope this is a better description of the problem,

regards Alex








Citeren Austin Nichols <[email protected]>:

> Or
>
> sysuse nlswide1, clear
> tw pcspike wage68 ttl_exp68 wage88 ttl_exp88 || pcarrowi 1 1 30 30,
> mcol(none)
>
>
> On Wed, Mar 30, 2011 at 11:09 AM, Nick Cox <[email protected]> wrote:
> > You have to use -ysc()- and -xsc()- to extend the range.
> >
> > Nick
> >
> > On Wed, Mar 30, 2011 at 4:02 PM,  <[email protected]> wrote:
> >>>
> >> I'm using -two way pcspike- to draw lines between paired coordinates, but
> have
> >> run into the following problem: suppose I want the x & y-axis to maintain
> the
> >> range (-3 to 3) but want to plot a line from (1,1) to (-100,-100), so that
> the
> >> line is drawn to a point outside the plot range, is this possible?
>
> *
> *   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/
>
>




*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index