I have my data graphed (Wetbulb Temperature vs. Time) and i would like to shade in certain regions of the grpah to represent as the temperature drops it moves into certain colored regions of the graph. Ive created horizontal lines at each point i would like to shade a different color but i cant seem to figure out how to fill in each region. Here is my code for my whole project. I will also attach the figure i get when i run the program
%% Clear windows
clear allclc%% load data
array1 = load ('prototype0.txt'); %load data from arduino sensors from a txt file
%% Define Variables from sensor data
Humidity= array1(:,1); %defines humidity from column 1 of array1
Pressure=array1(:,2); %defines Pressure from column 2 of array1
Altitude=array1(:,3); %defines Altitude from column 3 of array1
Temperature=array1(:,4); %defines Temperature from column 4 of array1
TimeMili=array1(:,5); %defines Time from column 7 of array1
Dewpoint=Temperature-((100-Humidity)/5);Wetbulb=Temperature-((Temperature-Dewpoint)/3);Time=TimeMili/1000;green=20+Time*0;yellow=28+Time*0;red=100+Time*0;base=0+Time*0;greenarea=[base,green];basearea=[base,base]figure(5)plot(Time,Wetbulb);title('Wetbulb Temperature vs. Time');xlabel('Time');ylabel('Wetbulb Temperature');axis([0 200 0 100]);hold onplot(Time,green)plot(Time,yellow)plot(Time,red)fill(basearea,greenarea,'g')
Best Answer