I am trying to plot 2 patchs with different color. " patch(x, y, c, 'FaceColor', 'flat');" shows error "Vectors must be the same length.". How to setup the color?
x =[ 1 2
1 2
2 3
2 3];
y =[1 2
2 3
2 3
1 2];
c=[0 0.7344
0 1.0000
0.5156 0.2656];
figure;
patch(x, y, 'r');
figure;
patch(x, y, c, 'FaceColor', 'flat');
Thanks,
cfy30
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/556291-patch-color-error-vectors-must-be-the-same-length#comment_916894
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/556291-patch-color-error-vectors-must-be-the-same-length#comment_916894
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/556291-patch-color-error-vectors-must-be-the-same-length#comment_916912
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/556291-patch-color-error-vectors-must-be-the-same-length#comment_916912
Sign in to comment.