reporting: fix figure inclusion for windows
parent
85905cbb1d
commit
99f4a01a48
|
@ -10346,7 +10346,7 @@ command. Default: @code{`!'}
|
|||
@end table
|
||||
@end defmethod
|
||||
|
||||
@defmethod Report addGraph data, figname, graphSize, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, seriesToUse, shade, shadeColor, shadeOpacity, title, xlabel, ylabel, xrange, xTickLabels, yrange, showZeroline
|
||||
@defmethod Report addGraph data, figname, figDirName, graphSize, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, seriesToUse, shade, shadeColor, shadeOpacity, title, xlabel, ylabel, xrange, xTickLabels, yrange, showZeroline
|
||||
Adds a @code{Graph} to a @code{Section}.
|
||||
@optionshead
|
||||
@table @code
|
||||
|
@ -10359,6 +10359,10 @@ The @code{dseries} that provides the data for the graph. Default:
|
|||
The name to use when saving this figure. Default: @code{[tempname
|
||||
`.tex']}
|
||||
|
||||
@item figDirName, @code{STRING}
|
||||
The name of the folder in which to store this figure. Default:
|
||||
@code{tmpFigDir}
|
||||
|
||||
@item graphSize, @code{NUMERICAL_VECTOR}
|
||||
The width and height to be passed to the third and fourth elements of
|
||||
the array passed to the @code{`Position'} option of Matlab's
|
||||
|
|
|
@ -135,12 +135,11 @@ end
|
|||
drawnow;
|
||||
|
||||
if isempty(o.figname)
|
||||
tn = tempname;
|
||||
[junk, tn] = fileparts(tempname);
|
||||
if strcmp(computer, 'PCWIN') || strcmp(computer, 'PCWIN64')
|
||||
tn = strrep(tn, '\', '/');
|
||||
tn = strrep(tn, '_', '\_');
|
||||
end
|
||||
o.figname = [tn '.tex'];
|
||||
o.figname = [o.figDirName filesep tn '.tex'];
|
||||
end
|
||||
disp(' converting to tex....');
|
||||
if isoctave && isempty(regexpi(computer, '.*apple.*', 'once'))
|
||||
|
|
|
@ -39,6 +39,7 @@ o.title = '';
|
|||
o.ylabel = '';
|
||||
o.xlabel = '';
|
||||
|
||||
o.figDirName = 'tmpFigDir';
|
||||
o.figname = '';
|
||||
o.data = '';
|
||||
o.seriesToUse = '';
|
||||
|
@ -92,6 +93,7 @@ assert(ischar(o.title), '@graph.graph: title must be a string');
|
|||
assert(ischar(o.xlabel), '@graph.graph: xlabel file must be a string');
|
||||
assert(ischar(o.ylabel), '@graph.graph: ylabel file must be a string');
|
||||
assert(ischar(o.figname), '@graph.graph: figname must be a string');
|
||||
assert(ischar(o.figDirName), '@graph.graph: figDirName must be a string');
|
||||
assert(islogical(o.showGrid), '@graph.graph: showGrid must be either true or false');
|
||||
assert(islogical(o.showLegend), '@graph.graph: showLegend must be either true or false');
|
||||
assert(islogical(o.showLegendBox), '@graph.graph: showLegendBox must be either true or false');
|
||||
|
@ -150,6 +152,10 @@ end
|
|||
o = rmfield(o, 'seriesToUse');
|
||||
o = rmfield(o, 'data');
|
||||
|
||||
if ~exist(o.figDirName, 'file')
|
||||
mkdir(o.figDirName);
|
||||
end
|
||||
|
||||
% Create graph object
|
||||
o = class(o, 'graph');
|
||||
end
|
Loading…
Reference in New Issue