'Arrows with free floating labels?
I need two arrows directed by their x and y directions with common starting point with free floating label or name label beside the respective arrows.
Let them have the following attributes:
the directions of V_1 and V_2 arrows are following in V_1_dir and V_2_dir with the first element indicating x direction and second element indicating y direction. Their positions on the plot does not matter as long as they have the common starting point as you can see in this sketch figure
. So, how to implement this plot?
V_1_dir=(-6.12434423682579, 10.780291438313702)
V_2_dir=(-3.5777616674816626, 5.394483317848412
Solution 1:[1]
Based on your question your problem is not really related to python, so I suggest using gnuplot for drawing. I have presented an example of a script which can be used to draw such arrows at 0,0 in gnuplot 5.0:
set terminal pngcairo size 500,500 enhanced
set tmargin at screen 0.90
set bmargin at screen 0.10
set lmargin at screen 0.10
set rmargin at screen 0.90
set output 'arrows.png'
set xrange [-16:1]
set yrange [-1:16]
set arrow from 0.0, 0.0 to -6.1243, 10.7803
set arrow from 0.0, 0.0 to -3.5778, 5.3945
set label "v_1" at -6.1243, 10.7803 offset screen -0.04,0
set label "v_2" at -3.5778, 5.3945 offset screen -0.04,0
plot "+" u 1:(NaN) w points notitle
The margins and ranges are set so that the distances and angles are correct. If you are interested in changing the style of arrows and labels, please expand the question and I'll edit my answer accordingly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Daniel Tcho? |
