Commit d81028ed authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: add legendAt option. closes #810

parent e1aaf293
......@@ -59,6 +59,7 @@ o.shadeOpacity = 20;
o.showGrid = true;
o.showLegend = false;
o.legendAt = [];
o.showLegendBox = false;
o.legendLocation = 'south east';
o.legendOrientation = 'horizontal';
......@@ -128,6 +129,8 @@ assert(islogical(o.showGrid), '@graph.graph: showGrid must be either true or fal
assert(islogical(o.xAxisTight), '@graph.graph: xAxisTight must be either true or false');
assert(islogical(o.yAxisTight), '@graph.graph: yAxisTight must be either true or false');
assert(islogical(o.showLegend), '@graph.graph: showLegend must be either true or false');
assert(isempty(o.legendAt) || (isfloat(o.legendAt) && length(o.legendAt)==2), ...
'@graph.graph: legendAt must be a double array of size two');
assert(islogical(o.showLegendBox), '@graph.graph: showLegendBox must be either true or false');
assert(islogical(o.showZeroline), '@graph.graph: showZeroline must be either true or false');
assert(isfloat(o.shadeOpacity) && length(o.shadeOpacity)==1 && ...
......
......@@ -169,7 +169,11 @@ if o.showLegend
if strcmp(o.legendOrientation, 'horizontal')
fprintf(fid,'legend columns=-1,');
end
fprintf(fid, '},\nlegend pos=%s,\n', o.legendLocation);
if isempty(o.legendAt)
fprintf(fid, '},\nlegend pos=%s,\n', o.legendLocation);
else
fprintf(fid, 'at={(%f,%f)}},\n',o.legendAt(1),o.legendAt(2));
end
end
fprintf(fid, 'tick label style={font=\\%s},\n', o.tickFontSize);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment