Statalist


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

st: RE: Labelling stacked histograms


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: Labelling stacked histograms
Date   Fri, 7 Nov 2008 18:17:10 +0100

This code gets rid of the pesky note in the corner:

**********
sysuse auto, clear
hist we,  by(foreign, cols(1) note("")) addl
*********

Could you specify in terms of this result what your other complaint was?


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of fran brittan
Sent: Friday, November 07, 2008 6:08 PM
To: [email protected]
Subject: st: Labelling stacked histograms

I have another question that should be very simple in theory, but I
couldn't work it out and neither could my colleagues.

I want a histogram of one variable broken down by another, such as
education levels by gender. I'm using the histogram var1, by var2
format. I want the two histograms that are produced as a result within
the combined graph to show the value label on top of each histogram,
instead of showing the numeric code. I have tested that the data has
the value labels I want, yet it's not showing up. I've tried
manipulating the legend option but it keeps giving the key to the
various aspects of the graphs (the density and the normal curve I
superimposed) rather than to the individual histograms.

Any help would be greatly appreciated!

My basic command is:

histogram var1, discrete by (var2, col(1)) gap(3) addl normal
yscale(range(. .6))

In addition, the overall graph (the combined histograms) has a note in
the corner that reads "Graph by var2". I can't change this with the
title command - if I add a title, this gets inserted above each
histogram (the same text above each, and above the value code), while
the "Graph by var2" notice stays unaffected.

This is the kind of thing that should take two seconds and just
devours time instead...
*
*   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/

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index