I'm trying to add a text box to a graph that has 2 y axes with different
scales. I can add the text to a single graph, and I can add the text to a
graph with 2 y variables if they are on the same axis, but when I add a
second y axis I get a mystifying error message. I've replicated the
problem below using the auto.dta dataset; commands and log are below. Am
I doing something wrong?
Thanks,
Brian
. sysuse auto, clear
(1978 Automobile Data)
.
. * Single scatterplot, text added
. twoway scatter mpg weight, text(41 2040 "VW Diesel", place(e))
.
. * Two scatter plots, single y axis, text added
. twoway scatter mpg weight, text(41 2040 "VW Diesel", place(e)) ||
///
scatter turn weight
.
. * Two scatter plots, two y axes with different scales, no text
. twoway scatter mpg weight || ///
scatter turn weight, yaxis(2)
.
. * Two scatter plots, two y axes with different scales, attempt to add
text
. twoway scatter mpg weight, text(41 2040 "VW Diesel", place(e)) ||
///
scatter turn weight, yaxis(2)
text() option invalid, specified axis pair (1 1) not in graph
invalid syntax
invalid syntax
invalid syntax
r(198);
end of do-file
r(198);
. * Two scatter plots, two y axes, a different attempt to add text
. twoway scatter mpg weight || ///
scatter turn weight, yaxis(2) ///
, text(41 2040 "VW Diesel", place(e))
text() option invalid, specified axis pair (1 1) not in graph
invalid syntax
invalid syntax
invalid syntax
r(198);
end of do-file
r(198);
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/