home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / GRAPHICS.DI$ / DC2SC.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  994 b   |  25 lines

  1. function [xs,ys] = dc2sc(xd,yd)
  2. %DC2SC    Data-coordinate to figure-coordinate conversion.
  3. %    DC2SC is obsolete, but provided for upward compatibility from
  4. %    MATLAB 3.5.
  5. %
  6. %     [Xs,Ys] = DC2SC(Xd,Yd) converts vectors or matrices Xd and Yd from 
  7. %     data-coordinates to normalized figure coordinates.  In 
  8. %    figure-coordinates, (0.0,0.0) is the lower-left corner of the figure
  9. %    and (1.0,1.0) is the upper-right corner.  For a 2-D plot, (Xmin,Ymin)
  10. %    is the lower-left corner of the axis box and (Xmax,Ymax) is the upper-
  11. %     right corner in data coordinates.  [Xmin Xmax Ymin Ymax] are the
  12. %     current axis settings as returned by AXIS. 
  13. %
  14. %     See also SC2DC.
  15.  
  16. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  17.  
  18. disp('This usage of dc2sc is obsolete and will be eliminated in future')
  19. disp('versions.  Please use normalized coordinates instead.')
  20. v = axis;
  21. axpos = get(gca,'position');
  22. xs = axpos(1) + (xd-v(1))*axpos(3)/(v(2)-v(1));
  23. ys = axpos(2) + (yd-v(3))*axpos(4)/(v(4)-v(3));
  24.  
  25.