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]
st: Selecting only certain labels for categorical variable in bar graph
From
Gilad Isaacs <[email protected]>
To
[email protected]
Subject
st: Selecting only certain labels for categorical variable in bar graph
Date
Tue, 18 Mar 2014 12:25:43 +0200
Hi,
First, thanks to Nick for answering a previous question of mine (I
don't know how to respond to that particular thread).
I am graphing a stacked bar graph of panel data, it is for the years
1970 - 2012, and it is the foreign exchange reserves for 10 countries.
I've done the following:
xtset year
graph bar reserve_per_world_GDP, over(countryname) over(year,
label(labsize(small) angle(60))) asyvars stack legend(on size(small)
col(4) symysize(1) symxsize(3))
It all works fine. However, the year labels: 1970, 1971, 1972 etc. on
the "x" axis, i.e. for the categorical variable "year", are
overlapping with one another. I'd like to be able to able to display
only every second year, like with a normal graph which would use
xlabel(1970(2)2012), or to space the bars further apart. If such a
option exists I'm sure it goes in the over(year...) command but I
don't know what the command is.
(Even if I make the year labels vertical, i.e. angle(90), they still
touch each other)
Also, is there a good website that lists all the commands that can be
used with "over"?
Thanks!
Gilad
*
* 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/