MATLAB Function Reference |
Refresh data in graph when data source is specified
Syntax
refreshdata
refreshdata(figure_handle)
refreshdata(object_handles)
refreshdata(object_handles,'workspace
')
Description
refreshdata
evaluates any data source properties (XDataSource
, YDataSource
, or ZDataSource
) on all objects in graphs in the current figure. If the specified data source has changed, MATLAB updates the graph to reflect this change.
Note that the variable assigned to the data source property must be in the base workspace.
refreshdata(figure_handle)
refreshes the data of the objects in the specified figure.
refreshdata(object_handles)
refreshes the data of the objects specified in objects_handles
or the children of those objects. Therefore, object_handles
can contain figure, axes, or plot object handles.
refreshdata(object_handles,'
enables you to specify whether the data source properties are evaluated in the base workspace or the workspace of the function in which workspace
')
refreshdata
was called. workspace
is a string that can be:
base
-- evaluate the data source properties in the base workspace.
caller
-- evaluate the data source properties in the workspace of the function that called refreshdata.
Examples
This example creates a contour plot and changes its data source. The call to refreshdata
causes the graph to update.
z = peaks(5);
[c h] = contour(z,'ZDataSource','z');
drawnow
pause(3) % Wait 3 seconds and the graph will update
z = peaks(20);
refreshdata(h)
See Also
The [X,Y,Z]DataSource
properties of plot objects.
refresh | regexp, regexpi |
© 1994-2005 The MathWorks, Inc.