How to change plot background color for some datapoints?
34 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rosi Marungu
am 4 Apr. 2016
Kommentiert: Walter Roberson
am 17 Aug. 2020
I would like to produce a plot as shown below. The feature I am looking are the different background colors for some of the datapoints. How can I do this?
Thank you!
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 4 Apr. 2016
You can use rectangular regions with fill(), or you can use rectangle() with a FaceColor . Either way, you can draw those background areas first, or if you draw them after the plot be sure to uistack() them to the beneath the plot lines.
5 Kommentare
Claire Andreasen
am 17 Aug. 2020
if you're using a grid, how would you make the grid appear overtop the rectangle?
Walter Roberson
am 17 Aug. 2020
Grids are considered part of an axes. You can have axes appear on top by setting the axes Layer property to 'top' instead of the default 'bottom'
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!