Mercurial > hg > ltpda
comparison m-toolbox/test/test_iplot_3.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 % Some iplot tests using the plotinfo | |
2 % | |
3 | |
4 mc | |
5 | |
6 %% tsdata | |
7 | |
8 p = plist('waveform', 'noise', 'fs', 10, 'nsecs', 10); | |
9 tsao1 = ao(p); | |
10 tsao1.setPlotinfo(plist('linestyle', '--', 'color', 'm', 'linewidth', 3, 'marker', 'x')); | |
11 | |
12 p = plist('waveform', 'sine wave', 'fs', 10, 'nsecs', 10, 'f', 1, 'phi', 0); | |
13 tsao2 = ao(p); | |
14 tsao2.setPlotinfo(plist('linestyle', '-.', 'color', [0.1 0.1 0.9], 'linewidth', 1, 'marker', '')); | |
15 | |
16 | |
17 ppl = plist('Linecolors', {'g', 'k'}, 'LineStyles', {'', '--'}, 'LineWidths', {1, 4}); | |
18 | |
19 iplot(tsao1,tsao2) | |
20 iplot(tsao1,tsao2, ppl) | |
21 | |
22 tsao1.setPlotinfo(plist) | |
23 tsao2.setPlotinfo(plist) | |
24 | |
25 iplot(tsao1,tsao2, ppl) | |
26 | |
27 tsao2.setPlotinfo(plist('legend_on', false)) | |
28 | |
29 iplot(tsao1,tsao2, ppl) | |
30 | |
31 | |
32 | |
33 %% fsdata | |
34 | |
35 fsd1 = resp(miir(plist('type','lowpass','fs', 100)), plist('f', logspace(-4, log10(50), 1000))); | |
36 fsd1 = fsd1.setYunits('m V^-1'); | |
37 fsd1.setPlotinfo(plist('linestyle', '-.', 'color', [0.1 0.1 0.9], 'linewidth', 3, 'marker', '')); | |
38 | |
39 fsd2 = psd(tsao1+tsao2); | |
40 fsd2.setPlotinfo(plist('linestyle', '-.', 'color', 'k', 'linewidth', 2, 'marker', '^')); | |
41 | |
42 fsd3 = fsd2*10; | |
43 | |
44 fsd4 = resp(miir(plist('type', 'highpass'))); | |
45 fsd4 = fsd4.setYunits('m V^-1'); | |
46 | |
47 iplot(fsd1, fsd2, fsd3) | |
48 | |
49 fsd3.setPlotinfo(plist('legend_on', false)) | |
50 | |
51 iplot(fsd1, fsd2, fsd3) | |
52 | |
53 | |
54 | |
55 %% xydata | |
56 | |
57 xy1 = ao(xydata(1:100, cos([1:100]/10))); | |
58 xy1 = xy1.setXunits('arb'); | |
59 xy1 = xy1.setYunits('arb'); | |
60 xy1.setPlotinfo(plist('linestyle', '--', 'color', [0.1 0.1 0.9], 'linewidth', 2, 'marker', 'd')); | |
61 | |
62 xy2 = ao(xydata(1:100, sin([1:100]/3))); | |
63 xy2 = xy2.setXunits('arb'); | |
64 xy2 = xy2.setYunits('arb'); | |
65 xy2.setPlotinfo(plist('linestyle', '', 'color', [], 'linewidth', 1, 'marker', '')); | |
66 | |
67 iplot(xy1, xy2) | |
68 | |
69 xy2.setPlotinfo(plist('legend_on', false)) | |
70 | |
71 iplot(xy1, xy2) | |
72 | |
73 | |
74 %% cdata | |
75 | |
76 cd1 = ao(1:100); | |
77 cd1.setPlotinfo(plist('linestyle', '-', 'color', [], 'linewidth', 3, 'marker', '')); | |
78 | |
79 cd2 = ao(1:100); | |
80 cd2.setPlotinfo(plist('linestyle', '', 'color', 'y', 'linewidth', 1, 'marker', 'o')); | |
81 | |
82 iplot(cd1,cd2) | |
83 | |
84 cd1.setPlotinfo(plist('legend_on', false)) | |
85 iplot(cd1,cd2) |