Changing color of the Matlab plot at different ranges

4 ビュー (過去 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.
  1 件のコメント
Hans123
Hans123 2019 年 4 月 5 日
works perfectly! Thanks, really appreciate it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-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