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

st: Formatting a twoway graph with different scaled y axes

From   René Geppert <>
Subject   st: Formatting a twoway graph with different scaled y axes
Date   Mon, 08 Dec 2008 20:45:43 +0100

Hi, I am using Stata/SE 10 for Windows.

I generated a graph using the following (simplified) code:

. twoway (bar var1 Quarter, yaxis(1) yscale(range(0))) (line var2 Quarter, yaxis(2) )

I do so in order to obtain two y-axes (left and right hand side) with a different scale. To format the graph properly I experienced two problems: a) Both axes start at their minimum values, which I can fix for the left hand side y-axis using yscale(range(0)), which does not work for the right hand side y-axis for some reason. Why is that and how can I achieve the same effect there? b) var 1 and var 2 have 6 observations (at each instance of Quarter). How can I get a label at each instance in the graph for the line and bar plot, respectively? That is, show the observation values for example inside each bar and above the line. The blabel option which one can usually use in a bar graph does not work in the twoway bar version.

regards, Rene
*   For searches and help try:

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