I've combined two different plots in the same axes with "hold on": a normal graph and a bar graph with stacked bars. I would like to mantain different colors for each part of the single bars, but when I plot the figure the bars turn into the same color, even if still separated in different parts. For example:
x=1:10y1=rand(1,10)y2=rand(10)figureyyaxis leftplot(x,y1)hold onyyaxis rightbar(x,y2,'stacked')
How can I keep different colors for each part?
Thanks so much
Best Answer