From 12c94e68818cffd1e31abc890dc6c467c5520089 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Wed, 24 Apr 2013 18:09:54 +0200
Subject: [PATCH] reporting: @graph: add option to turn legend box on or off

---
 matlab/reporting/@graph/createGraph.m | 4 +++-
 matlab/reporting/@graph/graph.m       | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/matlab/reporting/@graph/createGraph.m b/matlab/reporting/@graph/createGraph.m
index 8297a54cee..e3ca66c485 100644
--- a/matlab/reporting/@graph/createGraph.m
+++ b/matlab/reporting/@graph/createGraph.m
@@ -104,7 +104,9 @@ if o.legend
                 'location', o.legend_location);
     set(lh, 'FontSize', o.legend_font_size);
     set(lh, 'interpreter', 'latex');
-    legend('boxoff');
+    if o.legend_boxoff
+        legend('boxoff');
+    end
 end
 
 if ~isempty(o.xlabel)
diff --git a/matlab/reporting/@graph/graph.m b/matlab/reporting/@graph/graph.m
index d7a763f08d..94b174eb5e 100644
--- a/matlab/reporting/@graph/graph.m
+++ b/matlab/reporting/@graph/graph.m
@@ -52,6 +52,7 @@ o.yrange = '';
 o.grid = true;
 
 o.legend = false;
+o.legend_boxoff = false;
 o.legend_location = 'SouthEast';
 o.legend_orientation = 'horizontal';
 o.legend_font_size = 8;
@@ -91,6 +92,7 @@ assert(ischar(o.ylabel), '@graph.graph: ylabel file must be a string');
 assert(ischar(o.figname), '@graph.graph: figname must be a string');
 assert(islogical(o.grid), '@graph.graph: grid must be either true or false');
 assert(islogical(o.legend), '@graph.graph: legend must be either true or false');
+assert(islogical(o.legend_boxoff), '@graph.graph: legend_boxoff must be either true or false');
 assert(isint(o.legend_font_size), '@graph.graph: legend_font_size must be an integer');
 assert(islogical(o.zeroline), '@graph.graph: zeroline must be either true or false');
 valid_legend_locations = ...
-- 
GitLab