Changing color of the Matlab plot at different ranges
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hans123
am 5 Apr. 2019
Kommentiert: Hans123
am 5 Apr. 2019
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.
I have read the litreature on this issue on the forums and previously asked questions - but none of them related to my problem
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 5 Apr. 2019
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!