From 168acbe6433c1c9a84735a7eb29514cfc5ad85e0 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Fri, 20 Jun 2014 15:40:20 +0200 Subject: [PATCH] reporting: add graph option: zeroLineColor --- @graph/graph.m | 4 +++- @graph/writeGraphFile.m | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/@graph/graph.m b/@graph/graph.m index 2d9f975..d9bab84 100644 --- a/@graph/graph.m +++ b/@graph/graph.m @@ -62,6 +62,7 @@ o.legendOrientation = 'horizontal'; o.legendFontSize = 'tiny'; o.showZeroline = false; +o.zeroLineColor = 'black'; o.graphSize = []; o.xTicks = []; @@ -132,12 +133,13 @@ assert(ischar(o.xTickLabelAnchor), '@graph.graph: xTickLabelAnchor must be a str assert(isint(o.yTickLabelPrecision), '@graph.graph: o.yTickLabelPrecision must be an integer'); assert(islogical(o.yTickLabelFixed), '@graph.graph: yTickLabelFixed must be either true or false'); assert(islogical(o.yTickLabelZeroFill), '@graph.graph: yTickLabelZeroFill must be either true or false'); - valid_shadeColor = {'red', 'green', 'blue', 'cyan ', 'magenta', 'yellow', ... 'black', 'gray', 'darkgray', 'lightgray', 'brown', ... 'lime', 'olive', 'orange', 'pink', 'purple', 'teal', 'violet', 'white'}; assert(any(strcmp(o.shadeColor, valid_shadeColor)), ['@graph.graph: shadeColor must be one of ' ... strjoin(valid_shadeColor)]); +assert(any(strcmp(o.zeroLineColor, valid_shadeColor)), ... + ['@graph.graph: zeroLineColor must be one of ' strjoin(valid_shadeColor)]); valid_legend_locations = ... {'south west','south east','north west','north east','outer north east'}; diff --git a/@graph/writeGraphFile.m b/@graph/writeGraphFile.m index bfa4802..79b8af7 100644 --- a/@graph/writeGraphFile.m +++ b/@graph/writeGraphFile.m @@ -212,7 +212,8 @@ if ~isempty(o.shade) end if o.showZeroline - fprintf(fid, '%%zeroline\n\\addplot[black,line width=.5,forget plot] coordinates {(1,0)(%d,0)};\n',dd.ndat); + fprintf(fid, '%%zeroline\n\\addplot[%s,line width=.5,forget plot] coordinates {(1,0)(%d,0)};\n', ... + o.zeroLineColor, dd.ndat); end for i=1:ne -- GitLab