Announcement

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

  • adding a legend for xline

    Hello,

    I am trying something like below to add a legend for the green vertical xline that I added onto my scatter plot:

    scatter AUC Alpha, ///
    xline(`=bestAlpha[1]', lcolor(green)) ///
    xlab(0.1 "0.1" 0.6 "0.6" 1.1 "1.1" 1.6 "1.6" 2.1 "2.1" 2.6 "2.6" 3.1 "3.1" 3.6 "3.6" 4.1 "4.1" 4.6 "4.6") ///
    legend(order(1 "bestAlpha obtained from the training set") )

    But of course my syntax for the legend is wrong? I searched internet to find a way and tried various examples, but I couldn't get them to work.

    How can I add a legend for the green xline that I added onto the scatter plot? Thank you,

  • #2
    Better to make that a note or possibly an axis label, except watch out for how much space you eat up:


    Code:
    note("bestAlpha obtained from the training set")
    Don't search the internet. Rummage in the Graphics manual.

    Comment


    • #3
      Thank you Nick, once again! much appreciated

      Comment

      Working...
      X