Setting overlap colours in plot with transparent layers
Show older comments
I have a plot with 3 filled surfaces, generated by commands such as
band(i_condition) = fill(xconf,yconf_CI95, colours(i_condition, :), 'FaceAlpha',alpha, 'LineStyle','-');
where
colours = [
213,94,0; % M
86,180,233; % L
166,166,166; % M&L
] / 255;
A legend is added using
conditions = {'M', 'L', 'M&L'};
[lh,icons] = legend(band, conditions, 'FontSize',23, 'units','normalized', 'Location', 'Best');
PatchInLegend = findobj(icons, 'type', 'patch');
set(PatchInLegend, 'facea', alpha)
The result looks like this

As can be seen, the parts of the bands that overlap are coloured rather ambiguously, and it's hard to tell them apart from the 3 conditions whose colours are specified. I assume the combinations of colours for the overlaps are computed automatically by Matlab, but is there a way to override those, or in some other way control them, so that the overlap areas end up being more distinctively coloured?
Also, is there a way for those overlap colours to themselves feature in the legend, so that it's 100% clear for the reader?
Thanks for any help!
Accepted Answer
More Answers (0)
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!