How to use RGB with Plot3?

9 次查看(过去 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!

采纳的回答

Image Analyst
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 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by