Separate axis labels in Stata

If you use separate axis, e.g. to plot two different lines in one twoway environment in Stata, you might need to use separate axis. In order to properly set distinct titles for either axis, you can use the following code where y1_var and y2_var are the values plotted on the y axes.

If you use separate axis, e.g. to plot two different lines in one twoway environment in Stata, you might need to use separate axis. In order to properly set distinct titles for either axis, you can use the following code

twoway ///
(lfit y1_var x_var, ytitle("y1_var title")) ///
(lfit y2_var x_var, yaxis(2) ytitle("y2_var title", axis(2))), ///
xtitle("X title")

where y1_var and y2_var are the values plotted on the y axes.

Tags: