How to fill closed curves. The code I wrote can't be implemented, I don't know how to correct it, thanks for the answer.
Mostrar comentarios más antiguos
fig = openfig('biaozhunxinyuevv.fig');
fig = gcf;
axObjs = fig.Children;
dataObjs = axObjs.Children;
xt= dataObjs(1).XData;
yt= dataObjs(1).YData;
fill(xt,yt,'r')
plot(xt,yt,'ko')
hold on
Respuestas (1)
KSSV
el 11 de Mzo. de 2022
fig = gcf;
axObjs = fig.Children;
dataObjs = axObjs.Children;
xt= dataObjs(1).XData;
yt= dataObjs(1).YData;
fill(xt,yt,'r')
hold on
plot(xt,yt,'ko')
4 comentarios
Wesley
el 11 de Mzo. de 2022
KSSV
el 11 de Mzo. de 2022
open('biaozhunxinyuevv.fig');
a = get(gca,'Children');
xdata = get(a, 'XData');
xdata = [xdata{1} xdata{3}] ;
ydata = get(a, 'YData');
ydata = [ydata{1} ydata{3}] ;
patch(xdata,ydata,'r')
You can use your ocde also, but extract (1 and 3) data as shown.
Wesley
el 11 de Mzo. de 2022
KSSV
el 11 de Mzo. de 2022
Thanks is accepting the answer.. :)
Categorías
Más información sobre Graphics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!