www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcgraph/@XYScatter/setData.m
function setData(obj, xd, yd, lbls, lblstyle) %SETDATA Set new data into graph % % SETDATA(OBJ, XDATA, YDATA, LABELS, LABELSTYLE) sets new data and % optionally labels into the graph object. This minimises the redrawing % for the overall operation. % Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc. % disable listeners during the operations set(obj.hListXY, 'enabled', 'off'); obj.XData = xd; obj.YData = yd; if nargin>3 obj.LabelData = lbls; end if nargin>4 obj.LabelStyle = lblstyle; end set(obj.hListXY, 'enabled', 'on'); % Perform necessary redraws set(obj.hLine, 'XData', xd, 'YData', yd); pSetLabels(obj);