1
A
回答
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');
相關問題
- 1. 在Matlab中,如何在繪圖時控制顏色迭代器?
- 2. 繪製matlab中的顏色編碼圖
- 3. 如何使用不同的顏色來繪製信號在Matlab
- 4. 在Matlab中繪製各種顏色的線條R2014b
- 5. 在Matlab中繪製一張光盤,顏色隨角度變化
- 6. 在繪製循環中的多條線時保留顏色(Matlab)
- 7. 在Matlab中用不同顏色繪製兩個函數
- 8. 如何在matlab中繪製具有不同顏色和組的條形圖
- 9. 在Matlab中繪製多色線
- 10. 顏色繪製不同的顏色matplotlib
- 11. 如何繪製不同的顏色
- 12. 繪製matlab中同一顏色的恆定輪廓
- 13. 在WinCE中繪製dataGrid行顏色
- 14. 自定義顏色的Matlab繪圖
- 15. 在MATLAB中着色繪圖
- 16. 在調度中繪製Android ViewGroup子代顏色繪製
- 17. 如何在顏色變化的畫布上在Android上繪製漸變顏色?
- 18. 如何改變matlab繪圖的線條顏色(如colormap)?
- 19. 繪製特定顏色
- 20. 繪製MKPolyline填充顏色
- 21. Matlab中的單色顏色
- 22. 如何在Matlab中繪製曲線
- 23. 如何在matlab中繪製x,y,z?
- 24. 如何在MATLAB中繪製3D角度
- 25. Matlab:如何在3D中繪製文本
- 26. 如何在Matlab中繪製密度圖
- 27. 如何在MATLAB中繪製圖表?
- 28. 如何在pygame中繪製一條線並更改顏色?
- 29. 在Java中,如何繪製兩個不同顏色的矩形?
- 30. 如何在XNA中繪製具有特定顏色的圓?