1 | def do_plot_1d(data, vertical, title): |
---|
2 | if vertical: |
---|
3 | g = plotBin(data, 0) |
---|
4 | else: |
---|
5 | g = plotSpectrum(data, 0) |
---|
6 | g.activeLayer().setTitle(title) |
---|
7 | # end def |
---|
8 | |
---|
9 | raw = Load(Filename="MAR11001.raw") |
---|
10 | |
---|
11 | do_plot_1d(raw, vertical=False, title="spectrum axis on Y, numeric on X") |
---|
12 | do_plot_1d(raw, vertical=True, title="numeric axis on Y, spectrum on X") |
---|
13 | |
---|
14 | theta = ConvertSpectrumAxis(raw,Target="Theta") |
---|
15 | do_plot_1d(theta, vertical=False, title="numeric axis on Y, numeric on X.") |
---|
16 | do_plot_1d(theta, vertical=True, title="numeric axis on Y, numeric on X. ") |
---|
17 | |
---|
18 | # |
---|
19 | distr = CloneWorkspace(raw) |
---|
20 | ConvertToDistribution(distr) |
---|
21 | do_plot_1d(distr, vertical=False, title="spectrum axis on Y. numeric on X. WS is distribution") |
---|
22 | do_plot_1d(distr, vertical=True, title="numeric axis on Y. spectrum X. WS is distribution") |
---|
23 | |
---|
24 | # |
---|
25 | theta_distr = CloneWorkspace(theta) |
---|
26 | ConvertToDistribution(theta_distr) |
---|
27 | do_plot_1d(theta_distr, vertical=False, title="numeric axis on Y. numeric on X. WS is distribution") |
---|
28 | do_plot_1d(theta_distr, vertical=True, title="numeric axis on Y. numeric X. WS is distribution") |
---|
29 | |
---|
30 | ################################################################## |
---|
31 | # 2D |
---|
32 | def do_plot_2d(data, title): |
---|
33 | mm = importMatrixWorkspace(str(data)) |
---|
34 | g = mm.plotGraph2D() |
---|
35 | g.activeLayer().setTitle(title) |
---|
36 | # end def |
---|
37 | |
---|
38 | # |
---|
39 | do_plot_2d(raw, "spectrum axis on Y, numeric on X") |
---|
40 | # |
---|
41 | do_plot_2d(theta, "numeric axis on Y, numeric on X") |
---|
42 | # |
---|
43 | do_plot_2d(distr, "spectrum axis on Y, numeric on X. WS is distribution") |
---|
44 | |
---|
45 | # |
---|
46 | do_plot_2d(theta_distr, "numeric axis on Y, numeric on X. WS is distribution") |
---|
47 | |
---|