diff --git a/matlab/reporting/@graph/createGraph.m b/matlab/reporting/@graph/createGraph.m index e800416b4caa38340c037013120a16713acffcbb..4a14767b8b7c7b5644504050548de1ceee37f18d 100644 --- a/matlab/reporting/@graph/createGraph.m +++ b/matlab/reporting/@graph/createGraph.m @@ -54,8 +54,9 @@ else end ne = o.seriesElements.numElements(); +line_handles = zeros(ne, 1); for i=1:ne - o.seriesElements(i).getLine(dd); + line_handles(i) = o.seriesElements(i).getLine(dd); end x = 1:1:dd.ndat; @@ -98,7 +99,7 @@ set(gca,'XTick', x); set(gca,'XTickLabel', xlabels); if o.legend - lh = legend(o.seriesElements.getTexNames()); + lh = legend(line_handles, o.seriesElements.getTexNames()); set(lh, 'orientation', o.legend_orientation); set(lh, 'Location', o.legend_location); set(lh, 'FontSize', o.legend_font_size); diff --git a/matlab/reporting/@series/getLine.m b/matlab/reporting/@series/getLine.m index 61c4a5527a14671015bba1cf58ccb99dac4d8108..f4543a85c21f81686a8992eb887115306bc5aa0b 100644 --- a/matlab/reporting/@series/getLine.m +++ b/matlab/reporting/@series/getLine.m @@ -1,5 +1,5 @@ -function o = getLine(o, xrange) -%function o = getLine(o, xrange) +function h = getLine(o, xrange) +%function h = getLine(o, xrange) % Create the series % % INPUTS @@ -7,7 +7,7 @@ function o = getLine(o, xrange) % xrange [dynDates] range of x values for line % % OUTPUTS -% o [series] series object +% h [handle] handle to line % % SPECIAL REQUIREMENTS % none @@ -81,5 +81,5 @@ if ~isempty(o.graph_marker) opt = {opt{:}, 'MarkerFaceColor', o.graph_marker_face_color}; end -line(opt{:}); +h = line(opt{:}); end