annotate toolboxes/FullBNT-1.0.7/KPMtools/set_xtick_label_demo.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1
Daniel@0 2 % Generate some test data. Assume that the X-axis represents months.
Daniel@0 3 x = 1:12;
Daniel@0 4 y = 10*rand(1,length(x));
Daniel@0 5
Daniel@0 6 % Plot the data.
Daniel@0 7 h = plot(x,y,'+');
Daniel@0 8
Daniel@0 9 % Add a title.
Daniel@0 10 title('This is a title')
Daniel@0 11
Daniel@0 12 % Set the X-Tick locations so that every other month is labeled.
Daniel@0 13 Xt = 1:2:11;
Daniel@0 14 Xl = [1 12];
Daniel@0 15 set(gca,'XTick',Xt,'XLim',Xl);
Daniel@0 16
Daniel@0 17 % Add the months as tick labels.
Daniel@0 18 months = ['Jan';
Daniel@0 19 'Feb';
Daniel@0 20 'Mar';
Daniel@0 21 'Apr';
Daniel@0 22 'May';
Daniel@0 23 'Jun';
Daniel@0 24 'Jul';
Daniel@0 25 'Aug';
Daniel@0 26 'Sep';
Daniel@0 27 'Oct';
Daniel@0 28 'Nov';
Daniel@0 29 'Dec'];
Daniel@0 30
Daniel@0 31 set_xtick_label(months(1:2:12, :), 90, 'xaxis label');
Daniel@0 32
Daniel@0 33
Daniel@0 34
Daniel@0 35 if 0
Daniel@0 36
Daniel@0 37
Daniel@0 38 % Generate some test data. Assume that the X-axis represents months.
Daniel@0 39 x = 1:8;
Daniel@0 40 y = 10*rand(1,length(x));
Daniel@0 41
Daniel@0 42 % Plot the data.
Daniel@0 43 h = plot(x,y,'+');
Daniel@0 44
Daniel@0 45 S = subsets(1:3);
Daniel@0 46 str = cell(1,8);
Daniel@0 47 for i=1:2^3
Daniel@0 48 str{i} = num2str(S{i});
Daniel@0 49 end
Daniel@0 50 set_xtick_label(str);
Daniel@0 51
Daniel@0 52 end