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: st: Changing the scale of a graph


From   stef salvez <loggyedy@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Changing the scale of a graph
Date   Fri, 8 Jun 2012 18:05:22 +0200

Maybe the problem you described bove is similar to mine. I get a lot
of white space on the left of the plot

 Have a look:


clear all
cd d:\
input str8  (Austria	       Belgium	        )
 "2/11/08"     "07/12/08" 	
"30/11/08"	    "04/01/09" 	
"28/12/08"	    "01/02/09" 	
"25/01/09"	    "01/03/09"
"22/02/09"	    "29/03/09" 	
"22/03/09"	    "26/04/09" 	
"19/04/09"	    "24/05/09" 	
"17/05/09"	    "21/06/09" 	
"14/06/09"	    "19/07/09" 	
"12/07/09"	    "16/08/09" 	
"09/08/09"	    "13/09/09" 	
"06/09/09"	    "11/10/09" 	
"04/10/09"	    "08/11/09" 	
"01/11/09"	    "06/12/09" 	
"29/11/09"	    "03/01/10" 	
"27/12/09"	    "31/01/10" 	
"31/01/10"	    "28/02/10" 	
"28/02/10"	    "28/03/10" 	
"28/03/10"	    "25/04/10" 	
"25/04/10"	    "23/05/10" 	
"23/05/10"	    "20/06/10"
"20/06/10"	    "18/07/10" 	
"18/07/10"	    "15/08/10" 	
"15/08/10"	    "12/09/10"
"12/09/10"	    "10/10/10" 	
"10/10/10"	    "07/11/10" 	
"07/11/10"	    "05/12/10" 	
"05/12/10"	    "02/01/11" 	
"01/01/11"	    "30/01/11" 	
"30/01/11"	    "27/02/11"
"27/02/11"	    "27/03/11" 	
"27/03/11"	    "24/04/11" 	
"24/04/11"	    "22/05/11" 	
"22/05/11"	    "19/06/11" 	
"19/06/11"	    "17/07/11" 	
"17/07/11"	    "14/08/11" 	
"14/08/11"	    "11/09/11" 	
"11/09/11"	    "09/10/11" 	
"09/10/11"	    "06/11/11" 	

end
gen dAustria = date(Austria, "DM20Y")

gen dBelgium = date(Belgium, "DM20Y")

gen dA2 = dAustria - dAustria[_n-1]
gen dB2 = dBelgium - dBelgium[_n-1]
 gen Aus= 10
gen Bel = 9
gen t10 = (dAustria + dAustria[_n-1]) / 2
gen t9 = (dBelgium + dBelgium[_n-1]) / 2
                    	       	       	       	       	        	        	
 scatter Aus  dAustria, xsize(20) ysize(8)|| scatter Bel  dBelgium     || //
scatter Aus t10, ms(none) mla(dA2) mlabpos(910) || ///
scatter Bel t9 , ms(none) mla(dB2) mlabpos(910)
 yla(9 "Belgium"  10 "Austria"    , ang(h)) xla(, format(%td)) legend(off)








On 6/8/12, Austin Nichols <austinnichols@gmail.com> wrote:
> Nick--
> Hard to know what the poster means by excessive white space, but
> perhaps the desideratum is an approximate 45 degree angle in one of
> the series, which can be achieved by many means e.g. by changing the
> aspect ratio or the range on the x axis.
>
> clear
> input high low quarter7
> .2958866 .236993                               -6
> .2957524 .230218                               -5
> .2953402 .2316445                              -4
> .3119317 .2338386                              -3
> .3281921 .2446502                              -2
> .3232706 .2491048                              -1
> .3490512 .2641283                              0
> end
> scatter high low quarter7
> scatter high low quarter7, c(l l) xsize(2) ysize(5) name(aspect)
> scatter high low quarter7, c(l l) xla(-15/10) name(xaxis)
>
>
> On Thu, Jun 7, 2012 at 7:12 AM, Nick Cox <n.j.cox@durham.ac.uk> wrote:
>> From this I can do this
>>
>> clear
>> input high low quarter7
>> .2958866 .236993                               -6
>> .2957524 .230218                               -5
>> .2953402 .2316445                              -4
>> .3119317 .2338386                              -3
>> .3281921 .2446502                              -2
>> .3232706 .2491048                              -1
>> .3490512 .2641283                              0
>> scatter high low quarter7
>>
>> and I can't see any problem with that kind of graph. What am I missing
>> about your question may be more obvious to economists.
>>
>> Nick
>> n.j.cox@durham.ac.uk
>>
>> sebas nicaise
>>
>> I have generated a variable that determines the relative quarters to a
>> specific event :
>>  gen byte quarter7=0 if newviol==1
>>  replace quarter7=-7 if F7.newviol==1
>>  replace quarter7=-6 if F6.newviol==1
>>  replace quarter7=-5 if F5.newviol==1
>>  replace quarter7=-4 if F4.newviol==1
>>  replace quarter7=-3 if F3.newviol==1
>>  replace quarter7=-2 if F2.newviol==1
>>  replace quarter7=-1 if F.newviol==1
>>
>> Subsequently, I computed the median leverageratio for 2 groups (firms in
>> competitive and non competitive industries)
>> by quarter7, sort : egen float medianleverageratiolow =
>> median(leverageratiolow)
>> by quarter7, sort : egen float medianleverageratiohigh =
>> median(leverageratiohigh)
>>
>> Subset of data looks like this:
>> medianleverageratiohigh medianleverageratiolow quarter7
>> .2334801 .1243232                              .
>> .2334801 .1243232                              -7
>> .2958866 .236993                               -6
>> .2957524 .230218                               -5
>> .2953402 .2316445                              -4
>> .3119317 .2338386                              -3
>> .3281921 .2446502                              -2
>> .3232706 .2491048                              -1
>> .3490512 .2641283                              0
>> .2334801 .1243232                              .
>> .2334801 .1243232                              .
>> .2334801 .1243232                              .
>>
>> Nick
>>
>>> Can you give us a subset of your data that can be entered
>>> interactively to give us a chance of seeing what you mean?
>>
>> On Thu, Jun 7, 2012 at 10:50 AM, sebas nicaise <sebasnicaise@hotmail.com>
>> wrote:
>>
>>> > That is not what I mean, I want the graph to show the reader the
>>> > increase in leverage ratio up to a certain event, with the current
>>> > graph this is not clearly visible.
>>> >
>>> > ----------------------------------------
>>> >> Date: Thu, 7 Jun 2012 10:37:08 +0100
>>> >> Subject: Re: st: Changing the scale of a graph
>>> >> From: njcoxstata@gmail.com
>>> >> To: statalist@hsphsun2.harvard.edu
>>> >>
>>> >> If this is a characteristic of the data, I don't understand your
>>> >> complaint. If there are values near 0.2, the graph extends to show
>>> >> them.
>>> >>
>>> >> On Thu, Jun 7, 2012 at 10:24 AM, sebas nicaise
>>> >> <sebasnicaise@hotmail.com> wrote:
>>> >> > Yes the y-axis grid shows the intervals 0.20 0.21 0.22 ... 0.35 but
>>> >> > leaves alot of white space at the bottom. Therefore, the scatter
>>> >> > looks the same as it did without the ylabel constraint but with
>>> >> > different intervals.
>>> >> >
>>> >> > ----------------------------------------
>>> >> >> Date: Thu, 7 Jun 2012 10:16:56 +0100
>>> >> >> Subject: Re: st: Changing the scale of a graph
>>> >> >> From: njcoxstata@gmail.com
>>> >> >> To: statalist@hsphsun2.harvard.edu
>>> >> >>
>>> >> >> Sounds good then, or is there still a problem?
>>> >> >>
>>> >> >> Nick
>>> >> >>
>>> >> >> On Thu, Jun 7, 2012 at 10:12 AM, sebas nicaise
>>> >> >> <sebasnicaise@hotmail.com> wrote:
>>> >> >>
>>> >> >> > I typed the command: scatter medianleverageratiohigh
>>> >> >> > medianleverageratiolow quarter7, ylabel(0.20(0.01)0.35)
>>> >> >> >
>>> >> >> > When I plot the original graph,scatter medianleverageratiohigh
>>> >> >> > medianleverageratiolow quarter7, I do not have any outliers. Al
>>> >> >> > values(points) are between 0.20 and 0.35.
>>> >> >> >
>>> >> >>
>>> >> >> Nick Cox
>>> >> >>
>>> >> >> >> You are not giving the Stata command you typed or telling us
>>> >> >> >> much about your data.
>>> >> >> >>
>>> >> >> >> There must be a reason why you get a lot of white space. Most
>>> >> >> >> obviously one or more outlier(s) need to be accommodated. As
>>> >> >> >> already emphasised in this thread, whatever you do to -ysc()- or
>>> >> >> >> -yla()- will not cause data to be omitted.
>
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index