1

How can I add arrows for axes of frame?
This works well if there is no frame but it doesn't work when I added frame.

    Plot[Sin[x], {x, 0, 10}, PlotRange -> {{0, 10}, {0, 1.2}}, 
 AxesStyle -> Arrowheads[0.07]]

enter image description here

Adding frame:

Plot[Sin[x], {x, 0, 10}, Frame -> {{True, False}, {True, False}}, 
 PlotRange -> {{0, 10}, {0, 1.2}}, AxesStyle -> Arrowheads[0.07]]

enter image description here

hana
  • 2,388
  • 5
  • 19
  • With PlotRange -> {{-1.2, 10}, {-1.05, 1}} and AxesStyle -> {{Arrowheads[0.03], Dashing[0.003], Black}, {Arrowheads[0.03], Dashing[0.003], Black}} works fine for me. – E. Chan-López Jun 29 '22 at 02:48
  • 3
    It seems that the frame always cover the axis. If we only want to frame,maybe add arrows by using Epilog or Show Graphics. – cvgmt Jun 29 '22 at 03:07
  • You're right, @cvgmt, that option you mention is also viable. – E. Chan-López Jun 29 '22 at 03:24
  • @E.Chan-López how can I remove the unwated plot range there? I don't want to include region where it's not needed. – hana Jun 29 '22 at 03:31
  • I hoped this work but it doesn't. Plot[Sin[x], {x, 0, 10}, Frame -> {{True, False}, {True, False}}, PlotRange -> {{-0.01, 10}, {-0.01, 1}} , AxesStyle -> {{Arrowheads[0.03], Thickness[0.005], Black}, {Arrowheads[0.03], Thickness[0.005], Black}}] – hana Jun 29 '22 at 03:37

1 Answers1

4
Plot[Sin[x], {x, 0, 10}, PlotRange -> {{0, 10}, {0, 1.2}}, 
 Frame -> True, 
 Epilog -> {Inset[
    Graphics[{Black, Arrowheads[0.1], Arrow[{{0, 0}, {0, 0.2}}]}], 
    Scaled[{0, 0.95}]], 
   Inset[Rotate[
     Graphics[{Black, Arrowheads[0.1], 
       Arrow[{{0, 0}, {0, 0.2}}]}], -\[Pi]/2], Scaled[{0.97, 0}]]}, 
 ImagePadding -> 60, PlotRangeClipping -> False]   

enter image description here

MMA13
  • 4,664
  • 3
  • 15
  • 21
  • Thanks, how would you make these axes bolder (bigger thickness)? – hana Jun 29 '22 at 12:15
  • 1
    add FrameStyle -> {{Directive[Black, Thickness[0.01]], Directive[Black, Thickness[0.005]]}, {Directive[Black, Thickness[0.01]], Directive[Black, Thickness[0.005]]}} – MMA13 Jun 29 '22 at 12:48