Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Population-pyramid-like graph - positive barlabels on theleft?

From   Eric Cahuzac <>
Subject   Re: st: Population-pyramid-like graph - positive barlabels on theleft?
Date   Fri, 21 Jul 2006 15:29:03 +0200

It's still not the answer you want, but it's an exemple... close to Michael N. Mitchell: "A Visual Guide to Stata Graphics" example.
Where "Homme" and "femme" are numbers and "age" a discrete value.

replace homme= -homme/1e+3
replace femme = femme/1e+3
twoway (bar homme age, horizontal yaxis(1)) (bar femme age, horizontal yaxis(2)), /*
*/ ytitle("Ages", axis(1) orientation(horizontal)) /*
*/ ytitle("Ages", axis(2) orientation(horizontal)) /*
*/ xtitle("Population en milliers") /*
*/ legend(off) /*
*/ xlabel(-400 "400" -300 "300" -200 "200" 200(100)400) /*
*/ xsca(noline titlegap(-3.5)) /*
*/ ysca(axis(1) noline) ysca(axis(2) noline) /* */ ylab(0(10)100,angle(0) axis(1)) /* */ ylab(0(10)100,angle(0) axis(2)) /* */ title("Pyramide des âges de la france pour 2004") /*
*/ plotregion(style(none)) /*
*/ note("Source : Insee - Recensement de la population") /*
*/ text(90 -300 "Hommes") /*
*/ text(90 300 "Femmes")

Gawrich Stefan a écrit :

Hi everyone,

with cancer registry data I want to draw the sex-specific distribution of
cancer localisations on a population-pyramid-like diagram.

The difference to the population pyramid is that I have localisations
instead of age groups on the vertical axis, which differ by sex. So I have
different localisations to the left (women) and to the right (men). The
localisations are sorted by frequency and to obtain a homogeneous graph I
use the same number of bars/localisations on both sides.

I tried different graphing options and ended up using two "gr hbar" graphs
combined so far.
Whats missing is that I need to label the bars (abs. or rel. frequency) and
get negative values on the left side. Is there a way to obtain all positive
bar labels (just like the options for all positive axis labels)?

Best wishes

Dr. Stefan Gawrich
Hesse Health state Office
35683 Dillenburg
* For searches and help try:


Eric Cahuzac
Institut National de la Recherche Agronomique (INRA)
Station d'Economie et Sociologie Rurale (ESR)
Chemin de Borde-Rouge - Auzeville
Tel. (direct) (secrétariat)

*   For searches and help try:

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