MATLAB: Patch – how to choose colors

colorcolorspecpatch

Hey,
I'm having trouble getting a hold on Patch. I have this code:
xFit = logspace(4,8,1000);
yPredict = predint(fitresult,xFit,0.683,'functional','off');
x=[xFit;xFit];
y=[yPredict(:,1)';yPredict(:,2)'];
patch(x,y,1,'FaceColor','r')
I want it to create a filled area that is transparent red, but I can't even get it to be red… it's always black. I went over the documentation and didn't manage to do it myself… any help?

Best Answer

Ok, problem was basically the ; inside the vector definitions, should be:
x=[xFit xFit];
y=[yPredict(:,1)' yPredict(:,2)'];
Although in the end I didn't use them as I switched to the "area" function instead of patch, much better.
Related Question