From 3bebeb18324a1e2f3184cd871701710ebcdd84c3 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Thu, 19 Jan 2017 17:15:56 +0100 Subject: [PATCH] Legend for detailed plots --- matlab/graph_decomp_detail.m | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/matlab/graph_decomp_detail.m b/matlab/graph_decomp_detail.m index a64ccbb28..364a78af9 100644 --- a/matlab/graph_decomp_detail.m +++ b/matlab/graph_decomp_detail.m @@ -187,6 +187,26 @@ for j=1:nvar subplot(nrow,ncol,isub), set(gca,'ylim',a0(3:4)) end + +% make legend + axes('Position',[0.1 0.01 0.8 0.02],'units','normalized'); + axis([0 1 0 1]); + axis off; + hold on; + x1 = 0; + width = 1/2; + mylabels = {'Individual contrib.','Residual contrib.'}; + + for i=1:2 +% for i=1:comp_nbr + hl = fill([x1 x1 x1+0.3*width x1+0.3*width],[0 1 1 0],i); + hold on + ht = text(x1+0.4*width,0.3,mylabels{i},'Interpreter','none'); + hold on + x1 = x1 + width; + end + + if nfigs>1, suffix = ['_detail_' int2str(jf)]; else