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: Specifying barlook_option on sorted bar graph

From   Mathew Kiang <>
Subject   st: Specifying barlook_option on sorted bar graph
Date   Wed, 06 Apr 2011 21:03:10 -0400

It seems like it should be a simple command, but I've given up in frustration and turn here for help.

I'd like to make a series simple bar graphs (let's say two graphs), one variable at a time (let's say mpg then cost) over a categorical variable (e.g., carmodel), sorted in descending order for each; however, the catch is I want a specific car model differentiated in both graphs (via one of the barlook_options).

graph bar mpg, over(carmodel, sort(1) descending)
graph bar cost, over(carmodel, sort(1) descending)

As far as I can tell, when I use a barlook_option like bar(#, color()), I have to specify the #th bar, which may not be the same across both graphs. I could go back and manually change each, but this quickly gets tedious with many different models or many different graphs.

Any help would be greatly appreciated!

*   For searches and help try:

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