Announcement

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

  • Place arrows on marginsplot

    Dear all,

    I am attempting to place arrows pointing to vertical lines that I have drawn on a marginal plot. I have tried using the pcarrowi option with and without addplot but have not succeeded.

    This is what I have tried:

    Code:
    margins, at(xvar = (-23(2)33.8))
    marginsplot, addplot(pcarrowi -5 8) xline(8.5, lcolor(black) lwidth(tthin)) text(-5 6 "Some text", size(tiny)) ///
        recast(line) recastci(rarea) plotopts(lcolor(dknavy)) ci1opts(color(ltblue)) graphregion(color(white)) bgcolor(white) ///
        ylabel(-20(5)0, labsize(*0.6) nogrid) xlabel(#5, labsize(*0.6)) title("", size(vsmall))
    This does not work and only creates a legend. What I would like to place an arrow on the plot pointing from "Some text" to the vertical line drawn using xline. What am I doing wrong? Any help will be highly appreciated. Thank you!

    Sincerely,

    Chiara

  • #2
    Chiara,

    I haven't had a chance to try to reproduce your code on some data I have but the thing that stands out to me is that the pcarrowi call is not complete--it seems to only reference the starting point for the arrowhead line. If you go to the help file for the command, it indicates that the immediate values must have two sets of x and y coordinates. I'm a little surprised that the command doesn't return an error because the help file suggests that defining two sets of coordinates is not optional. So, you would need something like...

    Code:
    marginsplot, addplot(pcarrowi -5 8 0 0)
    That should draw an arrow from the point at y = -5 and x = 8 to the origin.

    Lance

    Comment


    • #3
      Dear Lance,

      Thank you very much for you reply and the suggestion. It works now

      It was an embarrassing mistake...

      Chiara

      Comment

      Working...
      X