Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- annotatedArrow[p_, q_, label_] := {
- Arrowheads[{{-0.05, 0},
- {$MachineEpsilon, 0.5,
- Graphics[Inset[Framed[Style[label, Medium],
- Background -> LightGray,
- FrameStyle -> Directive[Thickness[0], Opacity[0]]]]]},
- { 0.05, 1}}],
- Arrow[{p, q}]
- }
- Manipulate[
- Graphics[{annotatedArrow[{0, height}, {right, height}, "wannadance?"]},
- PlotRange -> {{0, 0.2}, {0, 0.25}}, ImageSize -> 200] // Framed,
- {{height, 0.2 }, 0, 0.24, LabeledSlider}, {{right , 0.136}, 0, 0.2 , LabeledSlider}
- ]
- Graphics[{
- Line[{{-1, 0}, {1, 0}}],
- Text[
- Framed[Style["wanndance?", Medium], Background -> LightGray,
- FrameStyle -> Directive[Thickness[0], Opacity[0]]],
- {0, 0},
- {0, 0},
- Through[{Cos, Sin}[ArcTan[$MachineEpsilon, Cos[Pi/2.]]]] (* direction vector *)
- }],
- ImageSize -> Tiny]
- annotatedArrow[p_, q_, label_] :=
- {Arrowheads[
- {{-0.05, 0},
- {Automatic, 0.5,
- Graphics[
- Inset[Framed[Style[label, Medium],
- Background -> LightGray,
- FrameStyle -> Directive[Thickness[0], Opacity[0]]]]]},
- {0.05, 1}}],
- Arrow[{p, q}]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement