Commit c8a88872 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: @graph: keep line handles for use with legend

parent 7ea21ca7
......@@ -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);
......
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment