How can I plot in GUIDE using plotmatrix function?

7 visualizaciones (últimos 30 días)
Guilherme Balvedi
Guilherme Balvedi el 5 de Dic. de 2016
Editada: Jan el 5 de Dic. de 2016
I'm working on a GUI and I need to plot a scatter plot matrix. I'm used to code in GUIDE like this:
X = [1 2 3; 4 5 6; 7 8 9];
plot(handles.axes1,X);
But when I write down:
X = [1 2 3; 4 5 6; 7 8 9];
plotmatrix(handles.axes1,X);
I get an empty figure.
How can I insert a plotmatrix in a GUI?

Respuesta aceptada

Jan
Jan el 5 de Dic. de 2016
Editada: Jan el 5 de Dic. de 2016
Your code uses the axes handle "handle.axes1" for plotting. But either "handles" should be unknown, the axes should have been destroyed before, or you draw to the figure created by GUIDE, if this is open. In most cases an error message in the command window should reveal the problem.
The solution is easy: Create the wanted axes obejct manually:
axesH = axes;
X = [1 2 3; 4 5 6; 7 8 9];
plotmatrix(axesH, X);

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by