Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. annotatedArrow[p_, q_, label_] := {
  2. Arrowheads[{{-0.05, 0},
  3. {$MachineEpsilon, 0.5,
  4. Graphics[Inset[Framed[Style[label, Medium],
  5. Background -> LightGray,
  6. FrameStyle -> Directive[Thickness[0], Opacity[0]]]]]},
  7. { 0.05, 1}}],
  8. Arrow[{p, q}]
  9. }
  10.  
  11. Manipulate[
  12. Graphics[{annotatedArrow[{0, height}, {right, height}, "wannadance?"]},
  13. PlotRange -> {{0, 0.2}, {0, 0.25}}, ImageSize -> 200] // Framed,
  14. {{height, 0.2 }, 0, 0.24, LabeledSlider}, {{right , 0.136}, 0, 0.2 , LabeledSlider}
  15. ]
  16.  
  17. Graphics[{
  18. Line[{{-1, 0}, {1, 0}}],
  19. Text[
  20. Framed[Style["wanndance?", Medium], Background -> LightGray,
  21. FrameStyle -> Directive[Thickness[0], Opacity[0]]],
  22. {0, 0},
  23. {0, 0},
  24. Through[{Cos, Sin}[ArcTan[$MachineEpsilon, Cos[Pi/2.]]]] (* direction vector *)
  25. }],
  26. ImageSize -> Tiny]
  27.  
  28. annotatedArrow[p_, q_, label_] :=
  29. {Arrowheads[
  30. {{-0.05, 0},
  31. {Automatic, 0.5,
  32. Graphics[
  33. Inset[Framed[Style[label, Medium],
  34. Background -> LightGray,
  35. FrameStyle -> Directive[Thickness[0], Opacity[0]]]]]},
  36. {0.05, 1}}],
  37. Arrow[{p, q}]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement