Pointer on the graph.

4 views (last 30 days)
Artyom
Artyom on 25 Jul 2012
Hi everyone. There is 1x100 array. Is there any function that can show me (for example with pointer or another color) on the graph all points that higher 100?
  1 Comment
Sumit Tandon
Sumit Tandon on 25 Jul 2012
One simple approach could be to use a combination of thresholding and logical indexing to identify these points and plot them. Example:
x = randi(150,[1,100]);
z = x;
z(x<100) = NaN;
hold on
plot(x)
plot(z,'*r')
hold off

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 25 Jul 2012
Sumit had a good suggestion if you want to use colors and marker shapes. If you want pointers like arrows, then you can use the annotation() function:
annotation
Create annotation objects
Syntax
annotation(annotation_type)
annotation('line',x,y)
annotation('arrow',x,y)
annotation('doublearrow',x,y)
annotation('textarrow',x,y)
annotation('textbox',[x y w h])
annotation('ellipse',[x y w h])
annotation('rectangle',[x y w h])
annotation(figure_handle,...)
annotation(...,'PropertyName',PropertyValue,...)
Of course you'd need the x,y coordinates of the arrow endpoints first.

More Answers (0)

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!