Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Set title for the second y-axis in scatter chart with by()

    Dear Statalisters,

    I plot the chart as below

    Code:
    twoway (scatter var1 rev, sort) (scatter var2 rev, sort yaxis(2) msymbol(square_hollow)), ///
    ylabel(0(100)500) by(, note("")) by(, legend(off)) by(periods) ytitle("1st title", axis(1)) ytitle("2nd-title", axis(2))
    But the y-title for the second axis does not appear. I tried many options in the dialog but it seems everything does not work.

    Could someone show me what is wrong with my plotting code? Note: I use Stata 15.

    Many thanks.

    Click image for larger version

Name:	chart1.png
Views:	1
Size:	49.3 KB
ID:	1485066

  • #2
    Consider this

    Code:
    sysuse auto, clear
    scatter turn trunk mpg, by(foreign, l1title(left) r1title(right))

    Comment


    • #3
      Perfecto! Thank a lot, Dr. Cox!

      Comment

      Working...
      X