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: controling x-axis size in graph hbar.


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: controling x-axis size in graph hbar.
Date   Fri, 22 Feb 2013 10:42:32 +0000

A different question is why you want to make these labels small in the
first place. This is the key information the graph is designed to
show, in your case percents of GDP by sector of economy, or some such.
It can get crowded on the categorical axis, obliging the graph
designer to squeeze labels a bit, but this is the y axis, and there
should be plenty of space.

Nick

On Fri, Feb 22, 2013 at 10:24 AM, Amadou DIALLO <[email protected]> wrote:
> As always, thanks Nick !
> I am learning a lot !
>
> 2013/2/22, Nick Cox <[email protected]>:
>> This is a question about axis label size, not axis size.
>>
>> -graph hbar- is a bit unusual in its syntax, but all you need is
>> documented in the help. There is absolutely no need to look on
>> Statalist for standard syntax issues.
>>
>> Here's the nub of the matter as documented in -help graph bar-:
>>
>> "-graph hbar- draws horizontal bar charts.  In a horizontal bar chart,
>> the numerical axis is still called the
>>     y axis...."
>>
>> To spell this out.
>>
>> 1. As far as -graph hbar- is concerned, the horizontal axis is the y
>> axis, as that shows the response. This shows numerical values, e.g.
>> actual values, means, etc.
>>
>> 2. Hence y implying response trumps the traditional terminology in
>> coordinate geometry that y implies the vertical axis.
>>
>> 3. A good reason for this is to allow users to change very easily from
>> -bar- to -hbar-, as _all_ they need to do is change -bar- to -hbar-,
>> or vice versa. They do not have to change -x- to -y- and -y- to -x- in
>> reference to titles, labels, scales, etc.
>>
>> 4. The other vertical axis is _not_ therefore called the y axis by
>> -graph hbar-. Nor is it the x-axis. Rather, Stata works with the idea
>> of a categorical axis.
>>
>> But as controlling -label()- within -over()- is not what you want, and
>> as you should be referring to the y axis, the solution to your problem
>> is
>>
>> ... yla(, labsize(small))
>>
>> Nick
>>
>> On Fri, Feb 22, 2013 at 9:32 AM, Amadou DIALLO <[email protected]>
>> wrote:
>>
>>> I want to control for the x-axis size in a hbar command, but after
>>> looking through many threads, have not been able to figure out the
>>> solution. I control the y-axis size in the over() option, but what
>>> about x-axis?
>>> When I include xlabel() option to control for the size, I get the
>>> error xaxis1 does not exist.
>>> I know there must be a solution in various messages but cannot locate.
>>> Many thanks fro usual help.
>>>
>>> graph hbar ag_pergdp edu_pergdp health_pergdp def_pergdp sp_pergdp
>>> tc_pergdp, over(year, label(labsize(vsmall))) // xlabel(,size(vsmall))
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index