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 on April 23, and its replacement, 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 <>
Subject   st: Suppress labeling of categorical axis values in graph bar/hbar
Date   Sat, 18 Dec 2010 22:13:07 +0100


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

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

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index