comparison m-toolbox/test/test_iplot_2.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function test_iplot_2
2
3
4 %% When cdata contains a matrix
5 c = ao(randn(10,10));
6 c1 = ao(randn(10,10));
7 c2 = ao(randn(10,10));
8
9
10 iplot(c, plist('Markers', 'o', 'LineStyles', '--'))
11
12 %% When cdata is complex
13
14 c = ao(complex(randn(1,100), randn(1,100)));
15
16 iplot(c, plist('LineStyles', 'none', 'Markers', 'x'))
17
18 %% Time-series with different start times
19
20 pl = plist('waveform', 'sine wave', 'f', 0.1, 'fs', 10, 'nsecs', 20);
21 a1 = ao(pl);
22 a1 = a1.setT0('2008-01-01 12:00:00.5');
23 a2 = ao(pl);
24 a2 = a2.setT0('2008-01-01 12:00:10');
25
26 iplot(a1,a2, plist('arrangement', 'stacked'))
27 iplot(a1,a2, plist('arrangement', 'subplots'))
28 iplot(a1,a2, plist('arrangement', 'single'))
29
30 close all
31 %% Set XRange for time-series
32
33 iplot(a1,a2, plist('arrangement', 'stacked', 'XRanges', [0 12]))
34 iplot(a1,a2, plist('arrangement', 'subplots', 'XRanges', {[0 12], [15 20]}))
35
36 %% Set YRanges for time-series
37
38 iplot(a1,a2, plist('arrangement', 'stacked', 'YRanges', [0 1]))
39 iplot(a1,a2, plist('arrangement', 'subplots', 'YRanges', {[-1 1], [-2 2]}))
40
41 %% Set XRange for cdata
42
43 iplot(c, plist('arrangement', 'stacked', 'XRanges', [0 12]))
44 iplot(c, c, plist('arrangement', 'subplots', 'XRanges', {[0 1], [1 2]}))
45
46 %% Set YRange for cdata
47
48 iplot(c, plist('arrangement', 'stacked', 'YRanges', [0 1]))
49 iplot(c, c, plist('arrangement', 'subplots', 'YRanges', {[-1 1], [-2 2]}))
50
51 %% Test 'all' line properties for cdata
52
53 iplot(c1, c1, plist('linecolors', {'ALL', 'c'}))
54 iplot(c1, c2, plist('linewidths', {'all', 4}))
55 iplot(c1, c2, plist('linestyles', {'all', '--'}))
56 iplot(c1, c2, plist('Markers', {'All', 'x'}))
57
58 %% Test 'all' axes properties for tsdata
59
60 iplot(c1, c2, plist('Yscales', {'All', 'lin'}))
61 iplot(abs(c1), abs(c2), plist('arrangement', 'subplots', 'Yscales', {'All', 'log'}))
62 iplot(c1, c2, plist('arrangement', 'subplots', 'Xscales', {'All', 'lin'}))
63 iplot(c1, c2, plist('arrangement', 'subplots', 'YRanges', {'All', [-3 10]}))
64
65 %% Test 'all' line properties for tsdata
66
67 iplot(a1, a2, plist('linecolors', {'ALL', 'c'}))
68 iplot(a1, a2, plist('linewidths', {'all', 4}))
69 iplot(a1, a2, plist('linestyles', {'all', '--'}))
70 iplot(a1, a2, plist('Markers', {'All', 'x'}))
71 close all
72
73 %% Test 'all' axes properties for tsdata
74
75 iplot(a1, a2, plist('Yscales', {'All', 'lin'}))
76 iplot(abs(a1), abs(a2), plist('arrangement', 'subplots', 'Yscales', {'All', 'log'}))
77 iplot(a1, a2, plist('arrangement', 'subplots', 'Xscales', {'All', 'lin'}))
78 iplot(a1, a2, plist('arrangement', 'subplots', 'YRanges', {'All', [-3 10]}))
79
80 %% Test 'all' line properties for fsdata
81
82 fsd1 = resp(miir(plist('type','lowpass','fs', 100)), plist('f', logspace(-4, log10(50), 1000)));
83 fsd1 = fsd1.setYunits('m V^-1');
84 fsd2 = psd(a1+a2);
85 fsd3 = fsd2*10;
86 fsd4 = resp(miir(plist('type', 'highpass')));
87 fsd4 = fsd4.setYunits('m V^-1');
88
89
90 iplot(fsd1, fsd2, fsd3, fsd4, plist('linecolors', {'ALL', 'c'}))
91 iplot(fsd1, fsd2, fsd3, fsd4, plist('linewidths', {'all', 4}))
92 iplot(fsd1, fsd2, fsd3, fsd4, plist('linestyles', {'all', '--'}))
93 iplot(fsd1, fsd2, fsd3, fsd4, plist('Markers', {'All', 'x'}))
94 close all
95
96 %% Test 'all' axes properties for fsdata
97
98 iplot(fsd1, fsd2, fsd3, fsd4, plist('Yscales', {'All', 'lin'}))
99 iplot(fsd1, fsd2, fsd3, fsd4, plist('arrangement', 'subplots', 'Yscales', {'All', 'log'}))
100 iplot(fsd1, fsd2, fsd3, fsd4, plist('arrangement', 'subplots', 'Xscales', {'All', 'lin'}))
101 iplot(fsd1, fsd2, fsd3, fsd4, plist('arrangement', 'subplots', 'YRanges', {'All', [1e-6 100]}))
102
103
104 end