Create a filling between cftool prediction bounds
Mostrar comentarios más antiguos
Hey there,
Not sure if it's even possible in Matlab, but since it's possible in other programs I'll ask :)
I have some data that I've fitted, and I've generated the code and I'm using this code to plot it:
fitresult = fit( xData, yData, ft, opts );
xFit = logspace(4,8,1000);
yFit = fitresult(xFit);
yPredict = predint(fitresult,xFit,0.683,'functional','off');
% Plot fit with data.
hold on
h = loglog(sample69_nv20_binw,sample69_nv20_bins,'rd',sample69_nv20_binw,sample69_nv20_bins,'r.',xFit,yFit,'r',xFit,yPredict,'r--');
This works well, but I would like to make the prediction area filled in light, transparent red color instead of marking the borders, similar to what you can see in the attached picture.
Is it possible? how so?
Respuesta aceptada
Más respuestas (1)
Dishant Arora
el 20 de Mzo. de 2014
You haven't attached anything, as per my guess *fill* will do the job. See this:
X = rand(1,100);
Y = rand(1,100)+1;
fill([1:100 , fliplr(1:100)] , [X , fliplr(Y)] , 'r')
3 comentarios
Yoav Romach
el 20 de Mzo. de 2014
Dishant Arora
el 20 de Mzo. de 2014
Transparency is only observed by image, surface, and, patch objects. So, use patch instead of fill. It's arguments are vertices of the polygon you want to fill.
Yoav Romach
el 21 de Mzo. de 2014
Categorías
Más información sobre Polygons en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!