Index: /issm/trunk-jpl/src/m/model/ProfileValues.m
===================================================================
--- /issm/trunk-jpl/src/m/model/ProfileValues.m	(revision 12374)
+++ /issm/trunk-jpl/src/m/model/ProfileValues.m	(revision 12375)
@@ -15,6 +15,6 @@
 
 %Some useful parameters
-layers=ceil(mean(md.geometry.thickness)/res_v);
-Z=bed:resolution:surface;
+layers=ceil(mean(md.geometry.thickness)/resolution);
+Z=(bed:resolution:surface)';
 X=xprof*ones(size(Z));
 Y=yprof*ones(size(Z));
Index: /issm/trunk-jpl/src/m/model/plot/plot_profile.m
===================================================================
--- /issm/trunk-jpl/src/m/model/plot/plot_profile.m	(revision 12374)
+++ /issm/trunk-jpl/src/m/model/plot/plot_profile.m	(revision 12375)
@@ -9,5 +9,5 @@
 %process model
 [x_m y_m z_m elements_m is2d isplanet]=processmesh(md,[],options);
-if ~is2d, error('only 3d model supported'); end
+if is2d, error('only 3d model supported'); end
 
 %Get number of curves and generate random colors
@@ -16,4 +16,12 @@
 color=eval([ colorm '(numcurves);']);
 options=removefield(options,'colormap',0); %back to default colormap
+
+%Get coordinates
+location=getfieldvalue(options,'profile');
+if ~isnumeric(location) | numel(location)~=2,
+	error('location provided not supported (should be [x y])');
+end
+xprof=location(1);
+yprof=location(2);
 
 %Loop over number of curves
@@ -32,10 +40,9 @@
 
 	%Compute profile value
-	[z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution)
+	[z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution);
 
 	%plot profile
 	subplot(nlines,ncols,i)
-	A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4); 
-	plot(data_interp,z,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1));
+	plot(data_interp,z,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1),'LineStyle','-');
 	hold on;
 end
@@ -45,3 +52,4 @@
 options=addfielddefault(options,'colorbar',0);
 options=addfielddefault(options,'ylabel','z');
+options=addfielddefault(options,'view',2);
 applyoptions(md,[],options);
