Borrar filtros
Borrar filtros

How to change plot background color for some datapoints?

17 visualizaciones (últimos 30 días)
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!

Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de Abr. de 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 comentarios
Claire Andreasen
Claire Andreasen el 17 de Ag. de 2020
if you're using a grid, how would you make the grid appear overtop the rectangle?
Walter Roberson
Walter Roberson el 17 de Ag. de 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'

Iniciar sesión para comentar.

Más respuestas (1)

Muhammad Usman Saleem
Muhammad Usman Saleem el 4 de Abr. de 2016

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by