www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgsurfview/@lineplot/plot.m

    function plot(obj,data)
%LINEPLOT/PLOT Plots the supplied data
%
% obj.plot(svdata)

%  Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc.


cla(obj.hAxes);

obj.hLines = [];
obj.hLegend = [];
obj.hText = [];
g = obj.PlotOptions.grid;
set(obj.hAxes,'XLimMode','auto','YLimMode','auto',...
    'XGrid',g,'YGrid',g,'ZGrid',g);

% If cursor mode is on.  We'll need to restore it later
cursormode = ~isempty(obj.hCrossHairs);
obj.hCrossHairs = [];

if obj.Type==1
    % "Single" line plot
    obj.plot1(data);
elseif obj.Type==2
    % Multiline plot
    obj.plot2(data);
else
    error(message('mbc:cgsurfview:lineplot:InvalidState'));
end

if cursormode
    obj.setCursorMode('on');
end

obj.PlotData = data;
obj.optionsChanged; % they haven't, but this function sorts out the Y-range