1 function AX=subplot1(M,N,varargin);
2 %-------------------------------------------------------------------------
3 % subplot1 function An improved subplot function
4 % Input : - If more than one input arguments are given,
5 % then the first parameter is the number of rows.
6 % If single input argument is given, then this is the
7 % subplot-number for which to set focus.
8 % This could a scalar or two element vector (
I,J).
10 % * variable number of parameters
11 % (in pairs: ...,Keywoard, Value,...)
12 % - 'Min' : X, Y lower position of lowest subplot,
13 % default is [0.10 0.10].
14 % - 'Max' : X, Y largest position of highest subplot,
15 % default is [0.95 0.95].
16 % - 'Gap' : X,Y gaps between subplots,
17 % default is [0.01 0.01].
18 % - 'XTickL' : x ticks labels option,
19 % 'Margin' : plot only XTickLabels in the
20 % subplot of the lowest row (default).
21 % 'All' : plot XTickLabels in all subplots.
22 % 'None' : don't plot XTickLabels in subplots.
23 % - 'YTickL' : y ticks labels option,
24 % 'Margin' : plot only YTickLabels in the
25 % subplot of the lowest row (defailt).
26 % 'All' : plot YTickLabels in all subplots.
27 % 'None' : don't plot YTickLabels in subplots.
28 % - 'FontS' : axis font size, default is 10.
29 % 'XScale' : scale of x axis:
32 % - 'YScale' : scale of y axis:
35 % Example: subplot1(2,2,'Gap',[0.02 0.02]);
36 % subplot1(2,3,
'Gap',[0.02 0.02],
'XTickL',
'None',
'YTickL',
'All',
'FontS',16);
37 % See also : subplot1c.m
39 % By : Eran O. Ofek June 2002
41 %-------------------------------------------------------------------------
64 %--- move focus to subplot # ---
69 Narg = length(varargin);
70 if (0.5.*Narg==floor(0.5.*Narg)),
81 XTickL = varargin{
I+1};
83 YTickL = varargin{
I+1};
85 FontS = varargin{
I+1};
87 XScale = varargin{
I+1};
89 YScale = varargin{
I+1};
91 error(
'Unknown keyword');
95 error(
'Optional arguments should given as keyword, value');
98 error(
'Illegal number of input arguments');
110 %--- move focus to subplot # ---
111 H = get(
gcf,'Children');
113 Ptot = sum(strcmp(
get(H,
'type'),
'axes'));
116 elseif (length(M)==2),
117 %--- check for subplot size ---
118 Pos1 = get(H(1),'Position');
121 PosN =
get(H(Icheck),
'Position');
124 NumberOfCol = Icheck - 1;
128 NumberOfRow = Ptot./NumberOfCol;
133 M = (Row-1).*NumberOfCol + Col;
136 error(
'Unknown option, undefined subplot index');
139 set(
gcf,
'CurrentAxes',H(M));
142 %--- open subplots ---
152 Xsize = (Xmax - Xmin)./N;
153 Ysize = (Ymax - Ymin)./M;
166 Col = Pi - (Row - 1)*N;
168 Xstart = Xmin + Xsize.*(Col - 1);
169 Ystart = Ymax - Ysize.*Row;
174 if (
false && Col == N) % N
175 axes(
'position',[Xstart,Ystart,Xbox+
max(min((Xbox+0.02)/3,0.02+0.02)+0.02,0.007),Ybox]);
177 AX(Pi) = axes(
'position',[Xstart,Ystart,Xbox,Ybox]);
180 %set(gca,
'position',[Xstart,Ystart,Xbox,Ybox]);
181 % set(gca,
'FontSize',FontS);
188 %--- erase XTickLabel ---
189 set(gca,'XTickLabel',[]);
194 set(gca,
'XTickLabel',[]);
196 error(
'Unknown XTickL option');
202 %--- erase YTickLabel ---
203 set(gca,'YTickLabel',[]);
208 set(gca,
'YTickLabel',[]);
210 error(
'Unknown XTickL option');
215 set(gca,
'XScale',
'linear');
217 set(gca,
'XScale',
'log');
219 error(
'Unknown XScale option');
224 set(gca,
'YScale',
'linear');
226 set(gca,
'YScale',
'log');
228 error(
'Unknown YScale option');
234 error(
'Unknown MoveFoc option');
double max(double v1, double v2)
Return maximum.
void gcf(double *gammcf, double a, double x, double *gln)
Returns the incomplete gamma function Q(a, x) evaluated by its continued fraction representation as g...
#define I(l, k)
Specified Index [l][k].
Parameters_structure parameters
Parameters structure, with all parameters from the parameters.ini file. The default parameters define...