Index: /issm/trunk/src/m/classes/@plotoptions/buildlist.m
===================================================================
--- /issm/trunk/src/m/classes/@plotoptions/buildlist.m	(revision 2404)
+++ /issm/trunk/src/m/classes/@plotoptions/buildlist.m	(revision 2404)
@@ -0,0 +1,64 @@
+function plotoptions=buildlist(plotoptions,varargin),
+%BUILDLIST - build list of plotoptions from input
+%
+%   Usage:
+%      plotoptions=buildlist(plotoptions,varargin)
+
+%check length of input
+if mod((nargin-1),2),
+	error('buildlist error message: an even number of plotoptions is required')
+end
+
+%first: build a pairoptions out of varargin:
+rawoptions=pairoptions(varargin{:});
+
+%get number of data to be plotted
+numberofplots=fieldoccurences(rawoptions,'data');
+plotoptions.numberofplots=numberofplots;
+
+%initialize plotoptions.list
+plotoptions.list=cell(numberofplots,1);
+for i=1:numberofplots,
+	plotoptions.list{i}=pairoptions;
+end
+
+%process plot options
+for i=1:size(rawoptions.list,1),
+
+	%option ends by #all
+	if  strncmpi(fliplr(rawoptions.list{i,1}),fliplr('#all'),4),
+
+		%Assign to all subplots
+		for j=1:numberofplots,
+			plotoptions.list{j}=addfield(plotoptions.list{j},rawoptions.list{i,1},rawoptions.list{i,2});
+		end
+
+	%option ends by #i
+	elseif ismember('#',rawoptions.list{i,1}),
+
+		%get suplot(s) associated
+		string=strsplit(rawoptions.list{i,1},'#');
+		plotnum=string{end};
+		field=string{1};
+
+		%assign to subplot
+		plotoptions.list{str2num(plotnum)}=addfield(plotoptions.list{str2num(plotnum)},field,rawoptions.list{i,2});
+
+	%assign option field to corresponding subplot
+	else
+
+		%go through all subplot and assign to the first one free
+		j=1;
+		while (j<=numberofplots),
+			if ~exist(plotoptions.list{j},rawoptions.list{i,1});
+				plotoptions.list{j}=addfield(plotoptions.list{j},rawoptions.list{i,1},rawoptions.list{i,2});
+				break
+			else
+				j=j+1;
+			end
+		end
+		if j>numberofplots,
+			disp(['plot info message: too many ''' rawoptions.list{i,1} ''' options']);
+		end
+	end
+end
Index: /issm/trunk/src/m/classes/@plotoptions/display.m
===================================================================
--- /issm/trunk/src/m/classes/@plotoptions/display.m	(revision 2404)
+++ /issm/trunk/src/m/classes/@plotoptions/display.m	(revision 2404)
@@ -0,0 +1,25 @@
+function display(plotoptions)
+%DISPLAY - displays the fields of a plotoptions element
+%
+%   echo function for 'plotoptions' class
+
+disp(sprintf('\n%s = \n',inputname(1)));
+disp(sprintf('   numberofplots: %i',plotoptions.numberofplots));
+if ~isempty(plotoptions.list),
+	disp(sprintf('   list: (%ix%i)',size(plotoptions.list,1),size(plotoptions.list,2)));
+	for i=1:size(plotoptions.list,1),
+		unit=plotoptions.list{i};
+		disp(sprintf('\n   options of plot number %i',i));
+		for j=1:size(unit.list,1)
+			if ischar(unit.list{j,2}),
+				disp(sprintf('     field: %-10s value: ''%s''',unit.list{j,1},unit.list{j,2}));
+			elseif isnumeric(unit.list{j,2}) & length(unit.list{j,2})==1,
+				disp(sprintf('     field: %-10s value: %g',unit.list{j,1},unit.list{j,2}));
+			else
+				disp(sprintf('     field: %-10s value: (%ix%i)',unit.list{j,1},size(unit.list{j,2},1),size(unit.list{j,2},2)));
+			end
+		end
+	end
+else
+	disp(sprintf('   list: empty'));
+end
Index: /issm/trunk/src/m/classes/@plotoptions/plotoptions.m
===================================================================
--- /issm/trunk/src/m/classes/@plotoptions/plotoptions.m	(revision 2404)
+++ /issm/trunk/src/m/classes/@plotoptions/plotoptions.m	(revision 2404)
@@ -0,0 +1,21 @@
+function options = plotoptions(varargin),
+%PLOTOPTIONS - constructor for plotoptions object
+%
+%   Usage:
+%      plotoptions = plotoptions(varargin)
+
+%check length of input
+if mod(nargin,2)==1,
+	error('plotoptions error message: an even number of options is required')
+end
+
+%create a pairoption object
+
+options.numberofplots=0;
+options.list=cell(0,0);
+options=class(options,'plotoptions');
+
+if nargin~=0,
+	%initialize list
+	options=buildlist(options,varargin{:});
+end
