Shaded areas in scatter figure

4 views (last 30 days)
Tom
Tom on 8 Feb 2012
I would like to emphasize 6 areas in a scatter figure by shading the background areas and labeling them. So far I could only emphasize the areas by adding lines (hv, hh1, hh0).
figure
scatter(iDLvector,kaDLvector,'DisplayName','iDLvector,kaDLvector')
xlabel('iDL')
ylabel('kaDL')
title('Displaced-Lognormal Distribution')
axis([-0.25 0.25 -3 3])
hv = line([0 0],[-3 3]);
hh1 = line([-0.25 0.25],[1 1]);
hh0 = line([-0.25 0.25],[0 0]);
set([hh0 hv hh1],'LineStyle','--','Color','k')
figure(gcf);
The first area would be (-0.25 0) for the horizontal and (1 3) for the vertical, the second area (-0.25 0) for the horizontal and (0 1) for the vertical, and so on...
Thank you very much!

Accepted Answer

Matt Tearle
Matt Tearle on 8 Feb 2012
Something like this?
patch([-0.25,0,0,-0.25],[1 1 3 3],[0.5 0 0.8],'FaceAlpha',0.4,'EdgeColor','none')
patch([0,0.25,0.25,0],[-3 -3,0,0],[0 1 0.5],'FaceAlpha',0.4,'EdgeColor','none')
(etc)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!