reporting: support a different shape for the axis in a graph

time-shift
Houtan Bastani 2014-06-24 15:51:29 +02:00
parent 7ccd26a17e
commit f2b4de1d8a
3 changed files with 17 additions and 3 deletions

View File

@ -11239,7 +11239,7 @@ command. Default: @code{`!'}
@end defmethod
@anchor{addGraph}
@defmethod Report addGraph data, graphDirName, graphName, graphSize, height, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, miscTikzAxisOptions, miscTikzPictureOptions, seriesToUse, shade, shadeColor, shadeOpacity, title, width, xlabel, ylabel, xAxisTight, xrange, xTicks, xTickLabels, xTickLabelAnchor, xTickLabelRotation, yAxisTight, yTickLabelFixed, yTickLabelPrecision, yTickLabelZeroFill, yrange, showZeroline, zeroLineColor
@defmethod Report addGraph axisShape, data, graphDirName, graphName, graphSize, height, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, miscTikzAxisOptions, miscTikzPictureOptions, seriesToUse, shade, shadeColor, shadeOpacity, title, width, xlabel, ylabel, xAxisTight, xrange, xTicks, xTickLabels, xTickLabelAnchor, xTickLabelRotation, yAxisTight, yTickLabelFixed, yTickLabelPrecision, yTickLabelZeroFill, yrange, showZeroline, zeroLineColor
Adds a @code{Graph} to a @code{Section}.
@optionshead
@table @code
@ -11248,6 +11248,12 @@ Adds a @code{Graph} to a @code{Section}.
The @code{dseries} that provides the data for the graph. Default:
@code{none}
@item axisShape, @code{`box'} | @code{`L'}
The shape the axis should have. @code{`box'} means that there is an axis line
to the left, right, bottom, and top of the graphed line(s). @code{`L'} means
that there is an axis to the left and bottom of the graphed line(s). Default:
@code{`box'}
@item graphDirName, @code{STRING}
The name of the folder in which to store this figure. Default:
@code{tmpRepDir}

View File

@ -40,6 +40,8 @@ o.titleFormat = '';
o.ylabel = '';
o.xlabel = '';
o.axisShape = 'box';
o.graphDirName = 'tmpRepDir';
o.graphName = '';
o.data = '';
@ -140,7 +142,8 @@ assert(any(strcmp(o.shadeColor, valid_shadeColor)), ['@graph.graph: shadeColor m
strjoin(valid_shadeColor)]);
assert(any(strcmp(o.zeroLineColor, valid_shadeColor)), ...
['@graph.graph: zeroLineColor must be one of ' strjoin(valid_shadeColor)]);
assert(any(strcmp(o.axisShape, {'box', 'L'})), ['@graph.graph: shadeColor ' ...
'must be one of ''box'' or ''L''']);
valid_legend_locations = ...
{'south west','south east','north west','north east','outer north east'};
assert(any(strcmp(o.legendLocation, valid_legend_locations)), ...

View File

@ -119,9 +119,14 @@ fprintf(fid, ['},\n',...
'width=%fin,\n'...
'height=%fin,\n'...
'scale only axis,\n'...
'axis lines=box,\n'...
'unbounded coords=jump,\n'], o.width, o.height);
if strcmpi(o.axisShape, 'box')
fprintf(fid, 'axis lines=box,\n');
elseif strcmpi(o.axisShape, 'L')
fprintf(fid, 'axis x line=bottom,\naxis y line=left,\n');
end
if ~isempty(o.title{1})
fprintf(fid, 'title style={align=center');
if ~isempty(o.titleFormat)