答案 0 :(得分:1)
没有准备好的Matlab函数来绘制那种颜色块 您可以使用几行代码绘制它。
我故意保持代码简单(没有循环,数组和结构):
%Read image from imgur hosting sight
I = imread('https://i.stack.imgur.com/z6Hlh.jpg');
figure, imshow(I), hold on
%x1, y1 - center coordinate of upper square.
x1 = 150;
y1 = 330;
text1 = '#684630'; %Color as hex string.
%Convert hex string to RGB triple.
color1 = hex2dec([text1(2:3); text1(4:5); text1(6:7)]);
x2 = x1;
y2 = y1+25;
text2 = '#211310';
color2 = hex2dec([text2(2:3); text2(4:5); text2(6:7)]);
x3 = x2;
y3 = y2+25;
text3 = '#b2b0ae';
color3 = hex2dec([text3(2:3); text3(4:5); text3(6:7)]);
%Plot squares as markers
plot(x1, y1, 'square', 'MarkerSize', 15, 'MarkerEdgeColor', color1/255, 'MarkerFaceColor', color1/255);
plot(x2, y2, 'square', 'MarkerSize', 15, 'MarkerEdgeColor', color2/255, 'MarkerFaceColor', color2/255);
plot(x3, y3, 'square', 'MarkerSize', 15, 'MarkerEdgeColor', color3/255, 'MarkerFaceColor', color3/255);
%Plot text
text(x1+20, y1, text1, 'FontSize', 12, 'FontName', 'Courier New', 'FontWeight', 'bold');
text(x2+20, y2, text2, 'FontSize', 12, 'FontName', 'Courier New', 'FontWeight', 'bold');
text(x3+20, y3, text3, 'FontSize', 12, 'FontName', 'Courier New', 'FontWeight', 'bold');