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]

st: Suppress labeling of categorical axis values in graph bar/hbar


From   Davide Cantoni <davide.cantoni@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Suppress labeling of categorical axis values in graph bar/hbar
Date   Sat, 18 Dec 2010 22:13:07 +0100

Hello,

I would like to draw a bar chart displaying the values of a given
variable for all the observations in the dataset. However, since there
are many observations, I would like to label only some of them (some
representative cases). Conceptually, this is similar to this working
example:

*** begin example
sysuse auto, clear
graph hbar (asis) price, over(make, sort(price))
*** end example

As you can see, putting all the labels on the categorical axis leads
to overcrowding. What I would like to do is to label only some
representative examples, e.g. only "Renault Le Car", "VW Diesel" and,
say, "Lincoln Versailles".  I guess I can achieve the suppression of
labels with some relabel() command inside the over() parenthesis, but
given the large number of observations, this would be incredibly
cumbersome. Any other suggestions?

Thanks in advance,

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