From eebdfd623cf02ed5888454cdcad696f4bc1abe83 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Fri, 3 May 2013 14:39:37 +0200 Subject: [PATCH] reporting: fix xticklabels --- matlab/reports/@graph/createGraph.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/matlab/reports/@graph/createGraph.m b/matlab/reports/@graph/createGraph.m index e870d53c0..d702a8d7d 100644 --- a/matlab/reports/@graph/createGraph.m +++ b/matlab/reports/@graph/createGraph.m @@ -95,8 +95,16 @@ if ~isempty(o.shade) end xticks = get(gca, 'XTick'); -[junk, ix, junk] = intersect(x, xticks); -set(gca, 'XTickLabel', xlabels(ix)); +xTickLabels = cell(1, length(xticks)); +for i=1:length(xticks) + if xticks(i) >= x(1) && ... + xticks(i) <= x(end) + xTickLabels{i} = xlabels{xticks(i)}; + else + xTickLabels{i} = ''; + end +end +set(gca, 'XTickLabel', xTickLabels); if o.legend lh = legend(line_handles, o.seriesElements.getTexNames(), ...