Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: AW: st: RE: Shifting graph axis


From   Susanne Elsas <susanne.elsas@uni-bamberg.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: AW: st: RE: Shifting graph axis
Date   Tue, 27 Jul 2010 14:20:56 +0200

this problem is easy to avoid:
instead of plotregion(margin(zero))
type plotregion( m(b=0) )

regards,
susanne

***
sysuse auto, clear
sc price weight, name(first, replace) nodraw
sc price weight, plotregion(margin(zero)) name(second, replace) nodraw
sc price weight, plotregion(m(b=0)) name(third, replace) nodraw
graph combine first second third

***

Martin Weiss schrieb:
<>
I am glad it has worked out for you! But note that there is a cost to the
-plotregion- strategy. Note how the leftmost data point in the right panel
intrudes into the y-axis in this example, for instance:



*************
sysuse auto, clear
sc price weight, name(first, replace) nodraw
sc price weight, plotregion(margin(zero)) name(second, replace) nodraw
graph combine first second
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Bert Jung
Gesendet: Dienstag, 27. Juli 2010 05:31
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: RE: Shifting graph axis

Many thanks Martin and Nick!  -plotregion(margin(zero))- seems to do
the trick nicely and concisely.

Bert

On Thu, Jul 22, 2010 at 12:34 PM, Nick Cox <n.j.cox@durham.ac.uk> wrote:
Try -plotregion(margin(zero))-.

Nick
n.j.cox@durham.ac.uk

Bert Jung

I am looking for a way to shift the x-axis to be plotted at a
particular y-value.  I would like to shift everything, labels,
markers, xtitle etc instead of adding a simple -yline()-.  In the
below example, how can I shift the x-axis to intersect where y=0?  How
does this work in a case with two y-axis?

sysuse auto, clear
twoway scatter mpg weight, yscale( range( 0(10)40 ) ) ylabel( 0(10)40 )

twoway ( scatter mpg weight ) ( scatter length weight, yaxis(2) ),
yscale( range(0(10)40) axis(1) )  ylabel( 0(10)40 , axis(1) )  yscale(
range(0(50)250) axis(2) )  ylabel( 0(50)250 , axis(2) )

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


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

--

 *

Dipl.-Soz. Susanne Elsas
Wissenschaftliche Mitarbeiterin

Otto-Friedrich-Universität Bamberg
Lehrstuhl Volkswirtschaftslehre, insb. Empirische Mikroökonomik
Feldkirchenstraße 21
D-96045 Bamberg

http://www.uni-bamberg.de/index.php?id=5420

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