Hello,
I have a bar plot that shows the value for each fluid type but I want the bar to be green if the value of the bar is larger than 0.7. The simplified code is as follows:
neworder = {'Hot Water' [0.2700]'Steamflood' [0.4500]'N2' [0.6800]'CO2' [1.0100]'HC' [1.0100]};for i=1:length(neworder) if cell2mat(neworder(i,2))<0.7 neworder1(i,:)=neworder(i,:); else neworder2(i,:)=neworder(i,:); endendfigurebarh([neworder1{:,2}],0.5,'b');set(gca,'YtickL',neworder1(:,1),... 'XLim',[0 1],... 'Color','white');hold onbarh([neworder2{:,2}],0.5,'g');set(gca,'YtickL',neworder2(:,1),... 'XLim',[0 1],... 'Color','white');
This code puts two values on the same plots as I wanted but some of the values disappear. What I want is I want to see 5 bars 3 of which are blue and the rest two are green.
Thank you very much in advance.
Best Answer