comparison toolboxes/FullBNT-1.0.7/KPMtools/set_xtick_label_demo.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1
2 % Generate some test data. Assume that the X-axis represents months.
3 x = 1:12;
4 y = 10*rand(1,length(x));
5
6 % Plot the data.
7 h = plot(x,y,'+');
8
9 % Add a title.
10 title('This is a title')
11
12 % Set the X-Tick locations so that every other month is labeled.
13 Xt = 1:2:11;
14 Xl = [1 12];
15 set(gca,'XTick',Xt,'XLim',Xl);
16
17 % Add the months as tick labels.
18 months = ['Jan';
19 'Feb';
20 'Mar';
21 'Apr';
22 'May';
23 'Jun';
24 'Jul';
25 'Aug';
26 'Sep';
27 'Oct';
28 'Nov';
29 'Dec'];
30
31 set_xtick_label(months(1:2:12, :), 90, 'xaxis label');
32
33
34
35 if 0
36
37
38 % Generate some test data. Assume that the X-axis represents months.
39 x = 1:8;
40 y = 10*rand(1,length(x));
41
42 % Plot the data.
43 h = plot(x,y,'+');
44
45 S = subsets(1:3);
46 str = cell(1,8);
47 for i=1:2^3
48 str{i} = num2str(S{i});
49 end
50 set_xtick_label(str);
51
52 end