How can I display a patch in App Designer?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hey,
I don´t know how I can display a patch in App Designer.
the patch-function is within a function that I want to use in App Designer. If I run the function itself, there is no problem to display the figure, but it always displayed in a seperated window, not in the App designer window. I already tried to just add app.uiaxes to the axes, but it still is dispayed in a seperate windwo.
Can anyone help?
Thank you a lot!!
Here`s a part of the code
function StartModelButtonPushed(app, event)
Model = Load_model(1,0);
[~,num_model] = size(v);
figure;
% show each model
for num=1:num_model
n=v(num);
daspect([1 1 1]);
xticks([]);
yticks([]);
zticks([]);
axis on;
% patch model
p = patch('Faces',Model(n).FV.faces,'Vertices',Model(n).FV.vertices,'EdgeColor',Model(n).EdegeColor, 'FaceColor','red');
patch('Faces',Model(n).Sensor.SensorListe_save(6).VerticesListe);
pg= plot(uiaxes,p);
hold on;
end
end
0 comentarios
Respuestas (1)
Raunak Gupta
el 16 de Mzo. de 2020
Hi,
From the question I see that you are using plot function while displaying the patch. Since patch support the axes parameters also you may directly plot the patch on the UIAxes. Here since the second patch command is not plotted on any previous axes, it is creating a new figure every time. If you plot the patch on given UIAxes, hold on command will not be required. Plotting a patch on UIAxes can be done as follows:
patch(uiaxes,'Faces',Model(n).FV.faces,'Vertices',Model(n).FV.vertices,'EdgeColor',Model(n).EdegeColor, 'FaceColor','red');
patch(uiaxes,'Faces',Model(n).Sensor.SensorListe_save(6).VerticesListe);
0 comentarios
Ver también
Categorías
Más información sobre Polygons en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!