Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. clear
  2. clc
  3.  
  4. %// Create/plot data
  5. x = -10:10;
  6. y1 = x.^2;
  7. y2 = 2*x-10;
  8.  
  9. plot(x,y1,'--r',x,y2,'-*k')
  10.  
  11. %// Add some text
  12. t1 = text(-6,10,'Curve 1');
  13. t2 = text(6,-4,'Curve 2');
  14.  
  15. %// Find text objects. Of course normally you would not know beforehand
  16. %their position
  17.  
  18. hText = findobj('Type','Text');
  19.  
  20. %// Get their position
  21. Text1Pos = get(hText(1),'Position')
  22. Text2Pos = get(hText(2),'Position')
  23.  
  24. Text1Pos =
  25.  
  26. 6 -4 0
  27.  
  28.  
  29. Text2Pos =
  30.  
  31. -6 10 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement