Changing color of the Matlab plot at different ranges

조회 수: 23 (최근 30일)
Hans123
Hans123 2019년 4월 5일
댓글: Hans123 2019년 4월 5일
Hi,
I want to have the below graph in two colors, the y-values > 600 should be red.
Right now I have a basic plot command.
PIC.bmp
I have read the litreature on this issue on the forums and previously asked questions - but none of them related to my problem

채택된 답변

Image Analyst
Image Analyst 2019년 4월 5일
Try this:
indexes = yValues > 600;
plot(x(~indexes), y(~indexes), 'b.', 'MarkerSize', 10); % Plot in blue first.
hold on;
plot(x(indexes), y(indexes), 'r.', 'MarkerSize', 10); % Plot in red next.

추가 답변 (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