reporting: add custom height/width to graphs

remove-priordens
Houtan Bastani 2014-02-11 13:21:23 +01:00
parent adda7d8604
commit 617db5ba64
2 changed files with 9 additions and 3 deletions

View File

@ -64,6 +64,9 @@ o.graphSize = [];
o.xTicks = [];
o.xTickLabels = {};
o.width = 6;
o.height = 4.5;
if nargin == 1
assert(isa(varargin{1}, 'graph'),['@graph.graph: with one arg you ' ...
'must pass a graph object']);
@ -104,6 +107,9 @@ assert(ischar(o.shadeColor), '@graph.graph: shadeColor must be a string');
assert(isfloat(o.shadeOpacity) && length(o.shadeOpacity)==1 && ...
o.shadeOpacity >= 0 && o.shadeOpacity <= 1, ...
'@graph.graph: o.shadeOpacity must be a real in [0 1]');
assert(isfloat(o.width), '@graph.graph: o.width must be a real number');
assert(isfloat(o.height), '@graph.height: o.width must be a real number');
valid_legend_locations = ...
{'North', 'South', 'East', 'West', ...
'NorthEast', 'SouthEast', 'NorthWest', 'SouthWest', ...

View File

@ -87,13 +87,13 @@ for i = 1:length(x)
end
end
fprintf(fid, '},\nx tick label style={rotate=45,anchor=east},\n');
fprintf(fid, ['width=6.0in,\n'...
'height=4.5in,\n'...
fprintf(fid, ['width=%fin,\n'...
'height=%fin,\n'...
'scale only axis,\n'...
'xmin=1,\n'...
'xmax=%d,\n'...
'ymin=%d,\n'...
'ymax=%d,\n'], dd.ndat, ymin, ymax);
'ymax=%d,\n'], o.width, o.height, dd.ndat, ymin, ymax);
if o.showGrid
fprintf(fid, 'xmajorgrids=true,\nymajorgrids=true,\n');