How to apply two masks simultaniously for plot
Show older comments
Hi all,
I have a data set of which I want to show the outcome in one plot. Four types of outcomes are possible: mask 1 & mask 2 are false, only one of those is true, and both are true. I can't figure out how the latter can be colored green. The last line of text is incorrect, but I can't find the right syntax.
Thank you all.
Koen
figure; hold on; % new figure window. enable overlaying of plots
plot(x,y,'r.'); % plot a red dot for all points
plot(x(mask1),y(mask1),'m.') % overwrite all points where mask1==true
plot(x(mask2),y(mask2),'c.') % overwrite all points where mask2==true
plot(x([mask2]&&[mask1]), y([mask2]&&[mask1]), 'g.')%overwrite all point where mask1 & mask2 are true.
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!