reporting: @graph: add option shade_opacity

remove-priordens
Houtan Bastani 2013-04-25 16:55:08 +02:00
parent 12c94e6881
commit a8c9f2afdd
2 changed files with 7 additions and 2 deletions

View File

@ -88,7 +88,7 @@ if ~isempty(o.shade)
% use patch bc area doesn't work with matlab2tikz
sh = patch([repmat(x1, 1, 2) repmat(x2, 1, 2)], ...
[yrange fliplr(yrange)], [0 1 0], ...
'FaceAlpha', .2);
'facealpha', o.shade_opacity);
children =get(gca(), 'children');
children = [children(2:end); sh];
set(gca(), 'children', children);

View File

@ -45,10 +45,12 @@ o.footnote = '';
o.figname = '';
o.data = '';
o.seriestouse = '';
o.shade = '';
o.xrange = '';
o.yrange = '';
o.shade = '';
o.shade_opacity = .2;
o.grid = true;
o.legend = false;
@ -95,6 +97,9 @@ assert(islogical(o.legend), '@graph.graph: legend must be either true or false')
assert(islogical(o.legend_boxoff), '@graph.graph: legend_boxoff must be either true or false');
assert(isint(o.legend_font_size), '@graph.graph: legend_font_size must be an integer');
assert(islogical(o.zeroline), '@graph.graph: zeroline must be either true or false');
assert(isfloat(o.shade_opacity) && length(o.shade_opacity)==1 && ...
o.shade_opacity >= 0 && o.shade_opacity <= 1, ...
'@graph.graph: o.shade_opacity must be a real in [0 1]']);
valid_legend_locations = ...
{'North', 'South', 'East', 'West', ...
'NorthEast', 'SouthEast', 'NorthWest', 'SouthWest', ...