필터 지우기
필터 지우기

How to change plot background color for some datapoints?

조회 수: 17 (최근 30일)
Rosi Marungu
Rosi Marungu 2016년 4월 4일
댓글: Walter Roberson 2020년 8월 17일
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!

채택된 답변

Walter Roberson
Walter Roberson 2016년 4월 4일
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
Claire Andreasen
Claire Andreasen 2020년 8월 17일
if you're using a grid, how would you make the grid appear overtop the rectangle?
Walter Roberson
Walter Roberson 2020년 8월 17일
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'

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 4월 4일

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by