diff --git a/@graph/graph.m b/@graph/graph.m index 2d9f9756065ff67cdc831c82c306543693a3f130..d9bab84806d184b80c94d846b2ef791e4944c3bc 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 bfa480245b62d9598a40ea6c1aea281dfc3c778d..79b8af745761434223d54139fd6724937af35839 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