Draw arrow in a plot
1,006 views (last 30 days)
francisco gonzalez on 22 May 2015
Hi all, i have a question. I am creating a GUI that import real time data. I want draw a vertical line or a arrow if a condition is met.
if p>100 && t>100
Is this correct for draw arrow in a plot in real time?
Thank you very much
Geoff Hayes on 23 May 2015
Francisco - you may want to read the documentation on annotation. Your code of
would not work since you are assigning the string arrow to a variable called annotation. Instead you would want to do something like
X = [0.5 0.5];
Y = [0 0.5];
which would draw an arrow starting at the coordinate (0.5,0) and ending at (0.5,0.5). (Note that the coordinates are specified in normalized figure units which means that the arrow would be drawn in the middle.)
While you need not provide the X and Y inputs to this function, be aware that the default values will be used in place (of them) so the arrow may not be drawn where you expect it to be.