Patch - Not enough input arguments
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to create a rectangle where the sides all have different colors. I found another question asking about this, but the answer there didn't seem to work. This is the code I'm trying to run:
X = [0,1,1,0];
Y = [0,0,2,2];
C = [1,0,0;0,1,0;0,0,1;1,1,0];
patch(X,Y,'FaceVertexCData',C,'EdgeColor','flat','FaceColor','none','LineWidth',2)
Yet I always get this error message:
Error using patch
Not enough input arguments.
I don't understand what inputs are missing here. How do I fix this?
0 comentarios
Respuestas (1)
Geoff Hayes
el 21 de Abr. de 2019
Axel - from patch you need to either provide a C the polygon colour specified as a scalar, vector, matrix, or a color name which may be the C you are passing in for the FaceVertextCData propery (though you may observe another error if you try to use this C for the polygon colour). Or you can just do
patch('XData', X, 'YData', Y, 'FaceVertexCData',C,'EdgeColor','flat','FaceColor','none','LineWidth',2)
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!