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


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: controling x-axis size in graph hbar.
Date   Fri, 22 Feb 2013 10:10:57 +0000

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 <stata.diallo@gmail.com> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index