home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / PLOTXY.DI$ / POLYMARK.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  1.7 KB  |  59 lines

  1. function h = polymark(x,y,style,opt_sc)
  2. %POLYMARK  Basic marker drawing primitive.
  3. %       POLYMARK is obsolete, but provided for upward compatibility from
  4. %       MATLAB 3.5.
  5. %
  6. %    POLYMARK(X,Y) draws polymarkers at the X- and Y-coordinates
  7. %    in vectors X and Y.
  8. %    POLYMARK(X,Y,'type') uses the marker style and color
  9. %    indicated by the text string.  See PLOT for a list of
  10. %    style and color attributes.
  11. %    POLYMARK(X,Y,'sc') interprets X and Y in screen-coordinates
  12. %    where (0.0,0.0) is the lower-left corner of the screen and
  13. %    (1.0,1.0) is the upper-right corner.  Otherwise, data-
  14. %    coordinates are used.
  15.  
  16. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  17.  
  18. disp('This usage of polymark is obsolete and will be eliminated in future')
  19. disp('versions.  Please use line instead.')
  20. opt = 'data';
  21. linestyle = '*';
  22. if nargin == 3
  23.     if strcmp(style,'sc')
  24.         opt = 'norm';
  25.     else
  26.         linestyle = style;
  27.     end
  28. elseif nargin == 4
  29.         if strcmp(opt_sc,'sc')
  30.                 opt = opt_sc;
  31.         else
  32.                 error('Invalid input argument.');
  33.         end
  34.     linestyle = style;
  35. end
  36. [a,b] = colstyle(linestyle);
  37. if isstr(x) | isstr(y)
  38.         error('Input data must be numeric.')
  39. end
  40. if strcmp(opt,'norm')
  41.     [xx,yy] = sc2dc(x,y);
  42. else
  43.     xx = x; yy = y;
  44. end
  45. cax = newplot;
  46. next = lower(get(cax,'NextPlot'));
  47. hold_state = ishold;
  48. if ~hold_state & strcmp(opt,'norm')
  49.         axis([0 1 0 1]);
  50.     if length(get(gca,'children')) == 0, set(gca,'box','on'),end
  51. end
  52. hh = line(xx,yy,'Clipping','off');
  53. if isempty(a), a = '*'; end
  54. if ~isempty(a), status = set(hh,'linestyle',a); end
  55. if ~isempty(b), status = set(hh,'color',b); end
  56. if nargout == 1
  57.     hh = h;
  58. end
  59.