[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: AW: Multiple histogram in same plot

From   "Nick Cox" <>
To   <>
Subject   st: RE: AW: Multiple histogram in same plot
Date   Thu, 16 Jul 2009 13:57:48 +0100

Rather, this sounds to me like a case for the -by()- option. 


Martin Weiss

Sounds much more like a -graph bar-:

sysuse auto, clear
graph bar (mean) price, ///
over(foreign, label(nolabel)) ///

mukta mukherjee

Could anybody tell me how to plot multiple histogram in the same
graph? I have 10 industry and would like to make histogram for the
variable say wages for each industry , but plot it column wise for
each industry.

I was trying the following code but without success.

capture   program drop _hist_
program define _hist_
su indusid if(indusid>=50) ,meanonly
forvalue a=`r(min)'/`r(max)'{
histogram(`1') if (indusid==`a') ,title ("Histogram for `1' and
graph save "$m`1'`a'",replace

global m "H:\Labor1\Fringe benefit tax\stata\All Industry"
*set trace on
_hist_ wages

*   For searches and help try:

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