フィルターのクリア

How do i make the background colour of my plot change in certain areas?

5 ビュー (過去 30 日間)
Nicki
Nicki 2013 年 11 月 25 日
編集済み: Nicki 2013 年 11 月 25 日
Hi, so I have this plot, it could be like this:
a=[[1:1440]'];
Totalset=[a a*0 (sin(a./20)+2)*100 a*0 cos(a./20)*9+20]
AX=plotyy(Totalset(:,1),Totalset(:,5),Totalset(:,1),Totalset(:,3))
set(AX(2),'ydir','rev')
hold on
set(get(AX(1),'Ylabel'),'String','Kernetemperatur(C)')
set(get(AX(2),'Ylabel'),'String','Dybde(m)')
y_venstre_min=10
y_venstre_max=30
y_hojre_min=50
y_hojre_max=300
set(AX(1),'YLim',[y_venstre_min,y_venstre_max])
set(AX(2),'YLim',[y_hojre_min,y_hojre_max])
And, now I have this matrix:
MTRX=[1 0 1 0 1 0 1 0;23 75 149 400 600 1100 1300 1400]'
I want my background to change to dark grey when MTRX(:,1)=1, and back to white when it goes back to 0 etc. So that my background would be white from 0 to 23, dark grey from 23 to 75, white from 75 to 149, dark grey from 149 to 400, and so on.
Is this possible, and do anyone have an example to help me get started I spent some time looking for this, but could only find how to change the colour of the entire background?
Best regards, Nicki Eriksen

採用された回答

Image Analyst
Image Analyst 2013 年 11 月 25 日
You'll probably need to use the patch() or fill() functions.
  1 件のコメント
Nicki
Nicki 2013 年 11 月 25 日
編集済み: Nicki 2013 年 11 月 25 日
Yes, that should be possible, thanks for the hint, it's been like 3 years since I used those, so I completely forgot about them.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by