Hello,
I would like to plot two imagesc bars displaying temperature over time to compair two years with each other. Since I want to plot some other graph on top of them, I need the "Temperature Bar" to be at a certain location on the y-axis in my plot:
W18_Y = [0 -0.5 -0.75 -0.3 0.1 0.2 0.3 0.4 0.4 0.3]';
W19_Y = [1 0.5 0.25 0 -0.1 -0.2 -0.1 0.2 0.4 0.3]';
SP18_Y = [100 105 106 103 101 102 103 104 104 103]'; SP18_T = [1:10]';
SP19_Y = [120 125 126 123 121 122 123 124 124 123]'; SP19_T = [11:20]'-10;
schnittpunkt = min([SP18_Y; SP19_Y])+((max([SP18_Y; SP19_Y])-min([SP18_Y; SP19_Y]))/2)
imagesc(W18_T',[min(SP18_Y) schnittpunkt],W18_Y');
imagesc(W19_T',[schnittpunkt max(SP19_Y)],W19_Y');
plot(SP18_T,SP18_Y,'LineWidth',2,'Color','k')
plot(SP19_T,SP19_Y,'LineWidth',2,'Color','k')
The problem is that even if I set " [min(SP18_Y) schnittpunkt] " as the "Bouderies" for my imagesc plot, it makes the Display much wider then I want.
I want the first bar to be plottet in the y-axis range of [min(SP18_Y) schnittpunkt] --> [100 113], but imagesc plots it at [87 126] ...
and the secound bar to be plottet in the y-axis range of [schnittpunkt max(SP19_Y)] --> [113 126], but imagesc plots it at [100 139]
How can I correct for it without "guessing" how wide to make the areas? I need to do this for a lot of different Variables at lot of different ranges, so trying by hand is not an option.
Thank you very much!