source: MML/trunk/machine/SOLEIL/common/naff/naffutils/plot_reson.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1function plot_reson(a,b,c,fen)
2% function plot_reson(a,b,c,fen)
3% plot resonance whose equation is: a*fx+ b*fz = c
4% in a windows whose dimensions are in fen=[xmin xmax zmin zmax]
5% eg:
6% plot_reson(3,1,65,[18 19 10 11])
7%
8% Laurent S. Nadolski, Synchrotron SOLEIL, 02/04
9
10%% Check input argument
11if nargin < 3
12    help reson
13    return
14end
15
16%% build straight line equation
17x=[fen(1) fen(2)];
18
19if (b ~=0)
20    y = (c-a*x)/b;
21elseif (a ==0 & b ==0)
22    % ne fait rien
23    return
24else
25    x = c/a*ones(2,1);
26    y = [fen(3) fen(4)];
27end
28
29%% define resonance order
30order = abs(a)+abs(b);
31
32%% appearance options depending on order
33width = 0.5;
34style = '-';
35
36switch order
37    case 1
38        color = 'k';
39        width = 3;
40    case 2
41        color = 'c';
42    case 3
43        color = 'm';
44        style = '--';
45    case 4
46        color = 'r';
47    case 5
48        color = 'b';
49    case 6
50        color = 'y';
51    case 7
52        color = 'g';
53    case 8
54        color = 'c';
55        style = '-.';
56    case 9
57        color = 'm';
58        style = '-.';
59    case 10
60        color = 'y';
61        style = '-.';
62    case 11
63        color = 'r';
64        style = '-.';
65    case 12
66        color = 'g';
67        style = '-.';
68    case 13
69        color = 'k';
70        style = '-.';
71    case 14
72        color = 'b';
73        style = '-.';
74    case 15
75        color = 'c';
76        style = '--';
77    otherwise
78        color ='k';
79        style = '--'
80end
81
82line(x,y,'LineWidth', width, 'LineStyle', style, 'Color',color);
Note: See TracBrowser for help on using the repository browser.