Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to add annotations to plots using plot own coordinate system
and not the figure?

Replies: 6   Last Post: Nov 11, 2012 4:57 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,647
Registered: 2/7/05
How to add annotations to plots using plot own coordinate system
and not the figure?

Posted: Nov 11, 2012 2:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have no used annotation in Matlab before. But it seems strange
that one can only use Figure based coordinates and not the
actual data used to make a plot.

For example, suppose I have a simple plot of a sin() and
want to make an arrow from (0,0) to say (pi,1):

--------------------
close all
x = -pi:pi/10:pi;
plot(x,sin(x));
------------------

Now if I use annotation('textarrow',x,y), then the 'x' and 'y' in
this call wants coordinates relating to the figure window itself
and not to the plot coordinates.

This makes these annotation useless really to use. One
now needs a way to map the plot data location (pi,1) to
find where it is physically located on the figure window.

Is there a way to be able to use these annotations but
use coordinates (x,y) based on the actual plot data
and not the figure itself?

http://www.mathworks.com/help/matlab/ref/annotation.html


thanks,
--Nasser






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.