0
votes

I am playing around with a Matlab gui. I have a function, that I feed 4 empty plots, and as it runs, each plot is updated with something like

set(hplot1, 'xData', updatedData)
drawnow

So before I call this function I create 4 blank plots with

handles.myplot1 = bar(NaN)
...

The function then runs on a button press and the plots are updated. However I only have 1 axes in the gui and would like to switch between which plot is shown. How can I go about this?

Lastly is there a way to create a blank surfc similar to what I did with bar(NaN)? Thanks for all the help.

1

1 Answers

0
votes

It looks like

set(hplot1, 'Parent', handles.axes1);

should work.

Setting the parent appears to be what I was looking for. Although I have an older version of matlab on my home machine so my gui won't actually run and I can't test it until tomorrow.

edit: This should work, but now my problem is creating blank plots without deleting the previous plot.

edit2: To create the plots I just use

a = figure(1); set(a, 'Visible', 'off')
handles.plot1 = bar()
b = figure(2); set(b, ...