필터 지우기
필터 지우기

How to use RGB with Plot3?

조회 수: 9 (최근 30일)
Bolin
Bolin 2017년 4월 17일
답변: Image Analyst 2017년 4월 17일
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