フィルターのクリア

Range limits with plot background color

10 ビュー (過去 30 日間)
Adam
Adam 2013 年 2 月 5 日
コメント済み: Inesteroide 2018 年 10 月 23 日
Hello Forum, I am trying to set the plot background of a series of plots to be white and for y-axis values above 60 grey. Is there a way to do this? I am trying to highlight values above a certain criteria. Other suggestions are welcome. Thanks.

採用された回答

Image Analyst
Image Analyst 2013 年 2 月 5 日
Maybe use the rectangle() or patch() function to lay down a gray rectangle in the appropriate place in the plot. Be sure to set "hold on" after that and before you plot your actual data.

その他の回答 (1 件)

Shashank Prasanna
Shashank Prasanna 2013 年 2 月 5 日
clf
plot(rand(10,1),'-o')
yUp = 0.7;
x=get(gca,'XLim');
y=get(gca,'YLim');
patch('XData',[x fliplr(x)],'YData',[yUp yUp y(2) y(2)],'FaceColor','r','FaceAlpha',0.3)
  2 件のコメント
Stan Kruger
Stan Kruger 2015 年 10 月 23 日
編集済み: Stan Kruger 2015 年 10 月 23 日
Works great, thanks for clear answer!
Inesteroide
Inesteroide 2018 年 10 月 23 日
Can you please share the code?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by