For example, the following code produces a graph with the mpg scale on the left y-axis and the price scale on the right y-axis. However, it does not print a y-title for the right-axis - only the left y-axis:

The Stata help for axis_choice_options suggests that you need to specify the axis as an option under ytitle (see p. 3-4), like this:
Page 6 of this PDF explicitly uses -ytitle(,axis(2))- as a twoway option.
However, when I do this as either a twoway option or as an option to the 2nd graph, the y-title still does not appear:
And the result is the same whether I use -scatter-, -line-, etc.
The only time the 2nd y-axis title will appear is when I remove the -by()- option:

Does anyone know how I can get the 2nd y-axis title when specifying the -by()- option?
Code:
preserve sysuse auto, clear twoway lowess mpg weight || lowess price weight, yaxis(2) ||, by(foreign) restore
The Stata help for axis_choice_options suggests that you need to specify the axis as an option under ytitle (see p. 3-4), like this:
Code:
ytitle("my 2nd y-axis title", axis(2))
However, when I do this as either a twoway option or as an option to the 2nd graph, the y-title still does not appear:
Code:
preserve sysuse auto, clear *ytitle(,axis(2)) as a Twoway Option twoway lowess mpg weight || lowess price weight, yaxis(2) ||, by(foreign) ytitle("my 2nd y-axis title", axis(2)) *ytitle(,axis(2)) as an Option to the Second Graph twoway lowess mpg weight || lowess price weight, yaxis(2) ytitle("my 2nd y-axis title", axis(2)) ||, by(foreign) restore
The only time the 2nd y-axis title will appear is when I remove the -by()- option:
Code:
twoway lowess mpg weight || lowess price weight, yaxis(2) ||, ytitle("my 2nd y-axis title", axis(2))
Does anyone know how I can get the 2nd y-axis title when specifying the -by()- option?
Comment