Home > functions > internal > dsPlotWaveforms.m

dsPlotWaveforms

PURPOSE ^

PLOTWAVEFORMS - plot waveforms in various ways depending on what data was provided.

SYNOPSIS ^

function plotWaveforms(data,varargin)

DESCRIPTION ^

PLOTWAVEFORMS - plot waveforms in various ways depending on what data was provided.

 Usage:
   dsPlotWaveforms(data,'option',value)

 Inputs:
   - data: DynaSim data structure (see dsCheckData)
   - options:
     'variable': name of field containing data to plot (default: all pops with
                 state variable of variable in data.labels)
     'time_limits': in units of data.time {[beg,end]}
     'max_num_overlaid': maximum # of waveforms to overlay per plot
     'max_num_rows': maximum # of subplot rows per figure

 Notes:
  if Nsims>1: one sim per row
  elseif Npops>1: one pop per row
  else: one cell per row

 Examples for specifying 'variable' option:
   []      : plot all data.labels with same variable name as first element of
             data.labels (eg, 'pop1_v' and 'pop2_v')
   '*'     : plot all data.labels
   '*_v'   : plot all data.labels ending in _v (i.e., all state variables 'v'
             for all populations)
   'pop1_*': plot all data.labels starting with pop1_ (i.e., all variables for
             population 'pop1')
   'pop1_v': plot only variable 'pop1_v'
   'v'     : look for all data.labels ending in _v then starting with v_ (eg,
             all populations with variable 'v')
   'pop1'  : look for all data.labels ending in _pop1 then starting with pop1_
             (eg, all variables for population 'pop1')
   '*_iNa_*': plot all data.labels for the 'iNa' mechanism (for all populations)

 Examples:
 - Example 1: One cell:
     data=dsSimulate('dv/dt=@current+10; {iNa,iK}');
     dsPlotWaveforms(data); % plot first state variable ('v')
     dsPlotWaveforms(data,'variable','*'); % plot all state variables
     % plot all variables and time 30-60ms
     dsPlotWaveforms(data,'variable','*','time_limits',[30 60]);

 - Example 2: One population: with noisy input
     data=dsSimulate('dv[5]/dt=@current+10*(1+randn(1,Npop)); {iNa,iK}');
     dsPlotWaveforms(data);
     dsPlotWaveforms(data,'variable','*'); % plot all state variables (all cells)
     dsPlotWaveforms(data,'variable','m'); % plot state variable 'm' (all cells)
     % plot all variables and time 30-60ms
     dsPlotWaveforms(data,'variable','*','time_limits',[30 60]);

 - Example 3: One population varying one parameter (input amplitude):
     eqns='dv[5]/dt=@current+amp*(1+randn(1,Npop)); {iNa,iK}';
     vary={'','amp',[0 10 20]};
     data=dsSimulate(eqns,'vary',vary);
     dsPlotWaveforms(data);
     dsPlotWaveforms(data,'variable','m');
     dsPlotWaveforms(data,'variable','*');

 - Example 4: One population varying two parameters (input amplitude and
              membrane capacitance):
     eqns='dv[5]/dt=@current/Cm+amp*(1+randn(1,Npop)); {iNa,iK}';
     vary={'','Cm',[1 2]; '','amp',[0 10 20]};
     data=dsSimulate(eqns,'vary',vary);
     dsPlotWaveforms(data);
     dsPlotWaveforms(data,'variable','*');

 - Example 5: Two populations: noisy input to E and excitatory connection from E to I
     spec=[];
     spec.populations(1).name='E1';
     spec.populations(1).equations='dv[5]/dt=@current+amp*(1+randn(1,Npop)); amp=10; {iNa,iK}';
     spec.populations(2).name='E2';
     spec.populations(2).equations='dv[2]/dt=@current; {iNa,iK}';
     spec.connections(1).direction='E1->E2';
     spec.connections(1).mechanism_list='iAMPA';
     data=dsSimulate(spec);
     dsPlotWaveforms(data); % plot first state variable
     dsPlotWaveforms(data,'variable','*');
     % plot monitored synaptic current with post-synaptic voltages:
     dsPlotWaveforms(data,'variable',{'E2_v','ISYN'});
     % plot monitored synaptic current with pre- and post-synaptic voltages:
     dsPlotWaveforms(data,'variable',{'v','ISYN'});

 - Example 6: Two populations varying one parameter (input amplitude):
     vary={'E1','amp',[0 10 20]};
     data=dsSimulate(spec,'vary',vary);
     dsPlotWaveforms(data);
     dsPlotWaveforms(data,'variable','*');
     dsPlotWaveforms(data,'variable','*_iNa_*');

 - Example 7: Two populations varying two parameters (input amplitude and
              synaptic conductance):
     vary={'E1','amp',[0 10 20]; 'E1->E2','gSYN',[0 .05 .1]};
     data=dsSimulate(spec,'vary',vary);
     dsPlotWaveforms(data,'variable','v');
     dsPlotWaveforms(data,'variable','ISYN');
     dsPlotWaveforms(data,'variable','E1_v');
     dsPlotWaveforms(data,'variable','*');

 See also: dsPlotFR, dsCheckData

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plotWaveforms(data,varargin)
0002 %PLOTWAVEFORMS - plot waveforms in various ways depending on what data was provided.
0003 %
0004 % Usage:
0005 %   dsPlotWaveforms(data,'option',value)
0006 %
0007 % Inputs:
0008 %   - data: DynaSim data structure (see dsCheckData)
0009 %   - options:
0010 %     'variable': name of field containing data to plot (default: all pops with
0011 %                 state variable of variable in data.labels)
0012 %     'time_limits': in units of data.time {[beg,end]}
0013 %     'max_num_overlaid': maximum # of waveforms to overlay per plot
0014 %     'max_num_rows': maximum # of subplot rows per figure
0015 %
0016 % Notes:
0017 %  if Nsims>1: one sim per row
0018 %  elseif Npops>1: one pop per row
0019 %  else: one cell per row
0020 %
0021 % Examples for specifying 'variable' option:
0022 %   []      : plot all data.labels with same variable name as first element of
0023 %             data.labels (eg, 'pop1_v' and 'pop2_v')
0024 %   '*'     : plot all data.labels
0025 %   '*_v'   : plot all data.labels ending in _v (i.e., all state variables 'v'
0026 %             for all populations)
0027 %   'pop1_*': plot all data.labels starting with pop1_ (i.e., all variables for
0028 %             population 'pop1')
0029 %   'pop1_v': plot only variable 'pop1_v'
0030 %   'v'     : look for all data.labels ending in _v then starting with v_ (eg,
0031 %             all populations with variable 'v')
0032 %   'pop1'  : look for all data.labels ending in _pop1 then starting with pop1_
0033 %             (eg, all variables for population 'pop1')
0034 %   '*_iNa_*': plot all data.labels for the 'iNa' mechanism (for all populations)
0035 %
0036 % Examples:
0037 % - Example 1: One cell:
0038 %     data=dsSimulate('dv/dt=@current+10; {iNa,iK}');
0039 %     dsPlotWaveforms(data); % plot first state variable ('v')
0040 %     dsPlotWaveforms(data,'variable','*'); % plot all state variables
0041 %     % plot all variables and time 30-60ms
0042 %     dsPlotWaveforms(data,'variable','*','time_limits',[30 60]);
0043 %
0044 % - Example 2: One population: with noisy input
0045 %     data=dsSimulate('dv[5]/dt=@current+10*(1+randn(1,Npop)); {iNa,iK}');
0046 %     dsPlotWaveforms(data);
0047 %     dsPlotWaveforms(data,'variable','*'); % plot all state variables (all cells)
0048 %     dsPlotWaveforms(data,'variable','m'); % plot state variable 'm' (all cells)
0049 %     % plot all variables and time 30-60ms
0050 %     dsPlotWaveforms(data,'variable','*','time_limits',[30 60]);
0051 %
0052 % - Example 3: One population varying one parameter (input amplitude):
0053 %     eqns='dv[5]/dt=@current+amp*(1+randn(1,Npop)); {iNa,iK}';
0054 %     vary={'','amp',[0 10 20]};
0055 %     data=dsSimulate(eqns,'vary',vary);
0056 %     dsPlotWaveforms(data);
0057 %     dsPlotWaveforms(data,'variable','m');
0058 %     dsPlotWaveforms(data,'variable','*');
0059 %
0060 % - Example 4: One population varying two parameters (input amplitude and
0061 %              membrane capacitance):
0062 %     eqns='dv[5]/dt=@current/Cm+amp*(1+randn(1,Npop)); {iNa,iK}';
0063 %     vary={'','Cm',[1 2]; '','amp',[0 10 20]};
0064 %     data=dsSimulate(eqns,'vary',vary);
0065 %     dsPlotWaveforms(data);
0066 %     dsPlotWaveforms(data,'variable','*');
0067 %
0068 % - Example 5: Two populations: noisy input to E and excitatory connection from E to I
0069 %     spec=[];
0070 %     spec.populations(1).name='E1';
0071 %     spec.populations(1).equations='dv[5]/dt=@current+amp*(1+randn(1,Npop)); amp=10; {iNa,iK}';
0072 %     spec.populations(2).name='E2';
0073 %     spec.populations(2).equations='dv[2]/dt=@current; {iNa,iK}';
0074 %     spec.connections(1).direction='E1->E2';
0075 %     spec.connections(1).mechanism_list='iAMPA';
0076 %     data=dsSimulate(spec);
0077 %     dsPlotWaveforms(data); % plot first state variable
0078 %     dsPlotWaveforms(data,'variable','*');
0079 %     % plot monitored synaptic current with post-synaptic voltages:
0080 %     dsPlotWaveforms(data,'variable',{'E2_v','ISYN'});
0081 %     % plot monitored synaptic current with pre- and post-synaptic voltages:
0082 %     dsPlotWaveforms(data,'variable',{'v','ISYN'});
0083 %
0084 % - Example 6: Two populations varying one parameter (input amplitude):
0085 %     vary={'E1','amp',[0 10 20]};
0086 %     data=dsSimulate(spec,'vary',vary);
0087 %     dsPlotWaveforms(data);
0088 %     dsPlotWaveforms(data,'variable','*');
0089 %     dsPlotWaveforms(data,'variable','*_iNa_*');
0090 %
0091 % - Example 7: Two populations varying two parameters (input amplitude and
0092 %              synaptic conductance):
0093 %     vary={'E1','amp',[0 10 20]; 'E1->E2','gSYN',[0 .05 .1]};
0094 %     data=dsSimulate(spec,'vary',vary);
0095 %     dsPlotWaveforms(data,'variable','v');
0096 %     dsPlotWaveforms(data,'variable','ISYN');
0097 %     dsPlotWaveforms(data,'variable','E1_v');
0098 %     dsPlotWaveforms(data,'variable','*');
0099 %
0100 % See also: dsPlotFR, dsCheckData
0101 
0102 % Check inputs
0103 data=dsCheckData(data, varargin{:});
0104 fields=fieldnames(data);
0105 
0106 options=dsCheckOptions(varargin,{...
0107   'time_limits',[-inf inf],[],...
0108   'variable',[],[],...
0109   'max_num_overlaid',50,[],...
0110   'max_num_rows',20,[],...
0111   'plot_mode','trace',{'trace','image'},...
0112   },false);
0113 
0114 % todo: add option 'plot_mode' {'trace','image'}
0115 
0116 % variables to plot
0117 var_fields=dsSelectVariables(data(1).labels,options.variable, varargin{:});
0118 tmp=regexp(var_fields,'_(.+)$','tokens','once');
0119 variables=unique([tmp{:}]);
0120 
0121 % populations to plot
0122 pop_names={data(1).model.specification.populations.name}; % list of populations
0123 % restrict to populations with variables to plot
0124 pop_indices=[];     % indices of populations to plot
0125 pop_var_indices={}; % indices of var_fields to plot per population
0126   % pop_var_indices{pop}(variable): index into var_fields
0127 for i=1:length(pop_names)
0128   % do any variables start with this population name?
0129   var_inds=find(~cellfun(@isempty,regexp(var_fields,['^' pop_names{i}])));
0130   if any(var_inds)
0131     inds=cellfun(@(x)find(~cellfun(@isempty,regexp(var_fields(var_inds),['_' x '$'],'once'))),variables,'uni',0);
0132     varsel=~cellfun(@isempty,inds);
0133     fldind=[inds{:}];
0134     pop_indices(end+1)=i;
0135     pop_var_indices{end+1}=nan(1,length(variables));
0136     pop_var_indices{end}(varsel)=var_inds(fldind);
0137   end
0138 end
0139 pop_names=pop_names(pop_indices);
0140 
0141 % data set info
0142 time=data(1).time; % time vector
0143 pop_sizes=[data(1).model.specification.populations(pop_indices).size];
0144 num_pops=length(pop_names); % number of populations to plot
0145 num_sims=length(data); % number of simulations
0146 num_vars=length(variables);
0147 num_labels=length(var_fields); % number of labels to plot
0148 num_times=length(time);
0149 
0150 MRPF = options.max_num_rows; % max rows per fig
0151 MTPP = options.max_num_overlaid; % max traces per plot
0152 
0153 % how many plots:
0154 if num_sims==1 && num_pops==1 && num_vars==1
0155   num_fig_sets=1; num_figs=ceil(pop_sizes/MRPF); num_rows=min(pop_sizes,MRPF);
0156 elseif num_sims==1 && num_pops==1 && num_vars>1
0157   num_fig_sets=1; num_figs=ceil(num_vars/MRPF); num_rows=min(num_vars,MRPF);
0158 elseif num_sims==1 && num_pops>1 && num_vars==1
0159   num_fig_sets=1; num_figs=ceil(num_pops/MRPF); num_rows=min(num_pops,MRPF);
0160 elseif num_sims==1 && num_pops>1 && num_vars>1
0161   num_fig_sets=num_vars; num_figs=ceil(num_pops/MRPF); num_rows=min(num_pops,MRPF);
0162 elseif num_sims>1 && num_pops==1 && num_vars==1
0163   num_fig_sets=1; num_figs=ceil(num_sims/MRPF); num_rows=min(num_sims,MRPF);
0164 elseif num_sims>1 && num_pops==1 && num_vars>1
0165   num_fig_sets=num_vars; num_figs=ceil(num_sims/MRPF); num_rows=min(num_sims,MRPF);
0166 elseif num_sims>1 && num_pops>1 && num_vars==1
0167   num_fig_sets=1; num_figs=ceil(num_sims/MRPF); num_rows=min(num_sims,MRPF);
0168 elseif num_sims>1 && num_pops>1 && num_vars>1
0169   num_fig_sets=num_vars; num_figs=ceil(num_sims/MRPF); num_rows=min(num_sims,MRPF);
0170 end
0171 
0172 % make subplot adjustments for varied parameters
0173 if num_sims>1 && isfield(data,'varied')
0174   % collect info on parameters varied
0175   varied=data(1).varied;
0176   num_varied=length(varied); % number of model components varied across simulations
0177   num_sims=length(data);
0178   % collect info on parameters varied
0179   param_mat=zeros(num_sims,num_varied);
0180   param_cell=cell(1,num_varied);
0181   for j=1:num_varied
0182     if isnumeric(data(1).(varied{j}))
0183       param_mat(:,j)=[data.(varied{j})];
0184       param_cell{j}=unique([data.(varied{j})]);
0185     else
0186       % todo: handle sims varying non-numeric model components
0187       % (eg, mechanisms) (also in dsPlotFR)
0188     end
0189   end
0190   param_size=cellfun(@length,param_cell);
0191   % varied parameter with most elements goes along the rows (everything else goes along columns)
0192   row_param_index=find(param_size==max(param_size),1,'first');
0193   row_param_name=varied{row_param_index};
0194   row_param_values=param_cell{row_param_index};
0195   num_rows=length(row_param_values);
0196   num_cols=num_sims/num_rows;
0197   sim_indices=[];
0198   for row=1:num_rows
0199     sim_indices=[sim_indices find(param_mat(:,row_param_index)==row_param_values(row))];
0200   end
0201 else
0202   sim_indices=ones(1,num_rows); % index into data array
0203   num_cols=1;
0204 end
0205 
0206 % set x-axis limits
0207 if isempty(options.time_limits)
0208   options.time_limits=[min(time) max(time)];
0209 end
0210 
0211 for figset=1:num_fig_sets
0212   for fig=1:num_figs
0213     ylims=[nan nan];
0214     % create figure
0215     figure('units','normalized','outerposition',[0 0 1 1])
0216     % position axes
0217     haxes=tight_subplot(num_rows,num_cols,[.01 .03],[.05 .01],[.03 .01]);
0218     axis_counter=0;
0219     % draw plots
0220     text_string=''; % string to add to subplot (set below)
0221     legend_string=''; % legend for subplot (set below)
0222     shared_ylims_flag=1;
0223     for row=1:num_rows
0224       for col=1:num_cols
0225         sim_index=sim_indices(col,row); % index into data array for this subplot
0226         axis_counter=axis_counter+1; % number subplot axis we're on
0227         % what to plot
0228         if num_sims==1 && num_pops==1 && num_vars==1
0229           % one cell per row: dat = data(s=1).(var)(:,c=r) where var=vars{v=1}
0230           var=var_fields{1};
0231           dat=data(sim_index).(var)(:,row);
0232           if num_rows>1
0233             text_string{row,col}=sprintf('cell %g',row);
0234           end
0235         elseif num_sims==1 && num_pops==1 && num_vars>1
0236           % one variable per row: dat = data(s=1).(var)(:,1:MTPP) where var=vars{v=r}
0237           var=var_fields{row};
0238           dat=data(sim_index).(var);
0239           shared_ylims_flag=0;
0240         elseif num_sims==1 && num_pops>1 && num_vars==1
0241           % one population per row: dat = data(s=1).(var)(:,1:MTPP) where var=vars{v=r}
0242           var=var_fields{row};
0243           dat=data(sim_index).(var);
0244         elseif num_sims==1 && num_pops>1 && num_vars>1
0245           % one population per row: dat = data(s=1).(var)(:,1:MTPP) where var=vars{these(p=r)}
0246           if isnan(pop_var_indices{row}(figset))
0247             continue;
0248           end
0249           var=var_fields{pop_var_indices{row}(figset)};
0250           dat=data(sim_index).(var);
0251         elseif num_sims>1 && num_pops==1 && num_vars==1
0252           % one simulation per row: dat = data(s=r).(var)(:,1:MTPP) where var=vars{v=1}
0253           var=var_fields{1};
0254           dat=data(sim_index).(var);
0255         elseif num_sims>1 && num_pops==1 && num_vars>1
0256           % one simulation per row: dat = data(s=r).(var)(:,1:MTPP) where var=vars{v++}
0257           if isnan(pop_var_indices{1}(figset))
0258             continue;
0259           end
0260           var=var_fields{pop_var_indices{1}(figset)};
0261           dat=data(sim_index).(var);
0262         elseif num_sims>1 && num_pops>1 && num_vars==1
0263           % one simulation per row, overlay pops: dat = <data(s=r).(var)(:,1:MTPP),2|vars>
0264           % calculate averages across populations
0265           dat=nan(num_times,num_pops);
0266           for k=1:num_pops
0267             if ~strcmp(reportUI,'matlab') && exist('nanmean') ~= 2 % 'nanmean is not in Octave's path
0268               try
0269                 pkg load statistics; % trying to load octave forge 'statistics' package before using nanmean function
0270               catch
0271                 error('nanmean function is needed, please install the statistics package from Octave Forge');
0272               end
0273             end
0274             dat(:,k)=nanmean(data(sim_index).(var_fields{k}),2);
0275           end
0276           var=['<' variables{1} '>'];
0277         elseif num_sims>1 && num_pops>1 && num_vars>1
0278           % one simulation per row, overlay pops: dat = <data(s=r).(var)(:,1:MTPP),2|vars(these)>
0279           % calculate averages across populations
0280           dat=nan(num_times,num_pops);
0281           for k=1:num_pops
0282             if isnan(pop_var_indices{k}(figset))
0283               continue;
0284             end
0285             var=var_fields{pop_var_indices{k}(figset)};
0286             try
0287                 pkg load statistics; % trying to load octave forge 'statistics' package before using nanmean function
0288               catch
0289                 error('nanmean function is needed, please install the statistics package from Octave Forge');
0290               end
0291             end
0292             dat(:,k)=nanmean(data(sim_index).(var),2);
0293           end
0294           var=['<' variables{figset} '>'];
0295         end
0296         if size(dat,2)>1
0297           legend_string=cellfun(@(x)['cell ' num2str(x)],num2cell(1:min(size(dat,2),10)),'uni',0);
0298         end
0299         if num_sims>1 && isfield(data,'varied')
0300           % list the parameter varied along the rows first
0301           str=[row_param_name '=' num2str(row_param_values(row)) ': '];
0302           for k=1:num_varied
0303             fld=data(sim_index).varied{k};
0304             if ~strcmp(fld,row_param_name)
0305               val=data(sim_index).(fld);
0306               str=[str fld '=' num2str(val) ', '];
0307             end
0308           end
0309           text_string{row,col}=['(' strrep(str(1:end-2),'_','\_') ')'];
0310           if num_pops>1
0311             legend_string=cellfun(@(x)[x ' (mean)'],pop_names,'uni',0);
0312           end
0313         end
0314         % plot data
0315         axes(haxes(axis_counter));
0316         if strcmp(options.plot_mode,'trace')
0317           % select max subset allowed
0318           dat=dat(:,1:min(size(dat,2),MTPP)); % select max subset to plot
0319           plot(time,dat);
0320         else
0321           imagesc(dat);
0322         end
0323         % format axes
0324         if row==num_rows
0325           xlabel('time (ms)');
0326         else
0327           set(haxes(axis_counter),'XTickLabel','');
0328           %set(haxes(row),'YTickLabel','');
0329         end
0330         xlim(options.time_limits);
0331         ylabel(strrep(var,'_','\_'));
0332         if shared_ylims_flag
0333           % update max/min
0334           ylims(1)=min(ylims(1),min(dat(:)));
0335           ylims(2)=max(ylims(2),max(dat(:)));
0336         else
0337           % set ylim to max/min of this data set
0338           ylims=[min(dat(:)) max(dat(:))];
0339           if ylims(1)~=ylims(2)
0340             ylim(ylims);
0341           end
0342           % add text
0343           if ~isempty(text_string)
0344             xmin=min(time); xmax=max(time);
0345             ymin=min(dat(:)); ymax=max(dat(:));
0346             text_xpos=xmin+.05*(xmax-xmin);
0347             text_ypos=ymin+.9*(ymax-ymin);
0348             text(text_xpos,text_ypos,text_string{row,col});
0349           end
0350         end
0351         if ~isempty(legend_string)
0352           legend(legend_string);
0353         end
0354       end % end loop over subplot columns
0355     end % end loop over subplot rows
0356     % set y-limits to max/min over data in this figure
0357     if shared_ylims_flag
0358       if ylims(1)~=ylims(2)
0359         set(haxes,'ylim',ylims);
0360       end
0361       if ~isempty(text_string)
0362         axis_counter=0;
0363         for row=1:num_rows
0364           for col=1:num_cols
0365             axis_counter=axis_counter+1;
0366             axes(haxes(axis_counter));
0367             xmin=min(time); xmax=max(time);
0368             ymin=min(ylim); ymax=max(ylim);
0369             text_xpos=xmin+.05*(xmax-xmin);
0370             text_ypos=ymin+.9*(ymax-ymin);
0371             text(text_xpos,text_ypos,text_string{row,col});
0372           end
0373         end
0374       end
0375     end
0376   end % end loop over figures in this set
0377 end % end loop over figure sets
0378 
0379 % 1 sim, 1 pop, 1 var (X)
0380 %     N=1        one fig, one row (plot var X)
0381 %     N>1        one row per cell (plot var X),             enough figs for all cells
0382 %     (nsims=1, num_pops=1, num_vars=1, pop_sizes>=1): num_fig_sets=1, num_figs=ceil(pop_sizes/MRPF), num_rows=min(pop_sizes,MRPF): row r: dat = data(s=1).(var)(:,c=r) where var=vars{v=1}
0383 %
0384 % 1 sim, 1 pop, >1 vars (X,Y,...)
0385 %     N=1        one row per var (plot cell 1),             enough figs for all vars
0386 %     N>1        one row per var (overlay cells),         enough figs for all vars
0387 %     (nsims=1, num_pops=1, num_vars>=1, pop_sizes>=1): num_fig_sets=1, num_figs=ceil(num_vars/MRPF), num_rows=min(num_vars,MRPF): row r: dat = data(s=1).(var)(:,1:MTPP) where var=vars{v=r}
0388 %
0389 % 1 sim, >1 pops, 1 var (X)
0390 %     all N=1        one row per pop (plot var X, cell 1),        enough figs for all pops
0391 %     any N>1        one row per pop (plot var X, overlay cells),     enough figs for all pops
0392 %     (nsims=1, num_pops>=1, num_vars=1, pop_sizes>=1): num_fig_sets=1, num_figs=ceil(num_pops/MRPF), num_rows=min(num_pops,MRPF): row r: dat = data(s=1).(var)(:,1:MTPP) where var=vars{v=r}
0393 %
0394 % 1 sim, >1 pops, >1 vars (X,Y,...)
0395 %     all N=1        one row per pop (plot var X, cell 1),         enough figs for all pops, separate figs for each var
0396 %     any N>1        one row per pop (plot var X, overlay cells),     enough figs for all pops, separate figs for each var
0397 %     (nsims=1, num_pops>=1, num_vars>=1, pop_sizes>=1): num_fig_sets=num_vars, num_figs=ceil(num_pops/MRPF), num_rows=min(num_pops,MRPF): row r: dat = data(s=1).(var)(:,1:MTPP) where var=vars{these(p=r)}
0398 %
0399 % >1 sim, 1 pop, 1 var (X)
0400 %     N=1        one row per sim (plot var X, cell 1),         enough figs for all sims
0401 %     N>1        one row per sim (plot var X, overlay cells),     enough figs for all sims
0402 %     (nsims>1, num_pops=1, num_vars=1, pop_sizes>=1): num_fig_sets=1, num_figs=ceil(nsims/MRPF), num_rows=min(nsims,MRPF): row r: dat = data(s=r).(var)(:,1:MTPP) where var=vars{v=1}
0403 %
0404 % >1 sim, 1 pop, >1 vars (X,Y,...)
0405 %     N=1        one row per sim (plot var X, cell 1),         enough figs for all sims, separate figs for each var
0406 %     N>1        one row per sim (plot var X, overlay cells),     enough figs for all sims, separate figs for each var
0407 %     (nsims>1, num_pops=1, num_vars=1, pop_sizes>=1): num_fig_sets=num_vars, num_figs=ceil(nsims/MRPF), num_rows=min(nsims,MRPF): row r: dat = data(s=r).(var)(:,1:MTPP) where var=vars{v++}
0408 %
0409 % >1 sim, >1 pops, 1 var (X)
0410 %     all N=1        one row per sim (plot var X, overlay pops),    enough figs for all sims
0411 %     any N>1        one row per sim (plot var <X>, overlay pops),    enough figs for all sims
0412 %     (nsims>1, num_pops=1, num_vars=1, pop_sizes>=1): num_fig_sets=1, num_figs=ceil(nsims/MRPF), num_rows=min(nsims,MRPF): row r: dat = <data(s=r).(var)(:,1:MTPP),2|vars>
0413 %
0414 % >1 sim, >1 pops, >1 vars (X,Y,...)
0415 %     all N=1        one row per sim (plot var X, overlay pops),    enough figs for all sims, separate figs for each var
0416 %     any N>1        one row per sim (plot var <X>, overlay pops),    enough figs for all sims, separate figs for each var
0417 %     (nsims>1, num_pops=1, num_vars=1, pop_sizes>=1): num_fig_sets=num_vars, num_figs=ceil(nsims/MRPF), num_rows=min(nsims,MRPF): row r: dat = <data(s=r).(var)(:,1:MTPP),2|vars(these)>
0418 
0419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005