How to use RGB with Plot3?
31 ビュー (過去 30 日間)
古いコメントを表示
I am simply trying to plot a point using Plot3 with a specific RGB color
plot3(1,2,3, 'Color',[255 153 51],'x')
This should give me an orange cross
After running this line, I get "Error using plot3, Not enough input arguments"
I've read the documentations and saw how other people implemented this, and I couldn't figure out where I went wrong. Help!
0 件のコメント
採用された回答
Image Analyst
2017 年 4 月 17 日
Your color is messed up - you need to divide by 255 to get the color values in the range of 0-1. This works fine:
plot3(1, 2, 3, 'x', 'Color', [255, 153, 51] / 255, 'MarkerSize', 30, 'LineWidth', 3);
grid on;
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!