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

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