Index: inundation/pyvolution/util.py
===================================================================
--- inundation/pyvolution/util.py	(revision 3213)
+++ inundation/pyvolution/util.py	(revision 3221)
@@ -599,4 +599,5 @@
     surface          - if True, then generate solution surface with 3d plot
                        and save to current working directory
+                     - default = False
     
     time_min         - beginning of user defined time range for plotting purposes
@@ -862,4 +863,6 @@
     for j, f in enumerate(f_list):
         if verbose: print 'swwfile %d of %d' %(j, len(f_list))
+        comparefile = file_loc[j]+sep+'gauges_maxmins'+'.csv'
+        fid_compare = open(comparefile, 'w')
         ##### loop over each gauge #####
         for k, g in enumerate(gauges):
@@ -874,4 +877,5 @@
             s = 'Time, Stage, Momentum, Speed \n'
             fid_out.write(s)
+            
             #### generate quantities #######
             for i, t in enumerate(f.get_time()):
@@ -901,15 +905,19 @@
                     s = '%.2f, %.2f, %.2f, %.2f\n' %(t, w, m, vel)
                     fid_out.write(s)
+                    if t/60.0 <= 13920: tindex = i
                     if w > max_stage: max_stage = w
                     if w < min_stage: min_stage = w
                     if m > max_momentum: max_momentum = m
-                    if vel > max_speed: max_speed = vel            
-            
+                    if vel > max_speed: max_speed = vel
+                    
+                    
+            s = '%.2f, %.2f, %.2f, %s\n' %(max_stage, min_stage, z, leg_label[j])
+            fid_compare.write(s)
             max_stages.append(max_stage)
             min_stages.append(min_stage)
             max_momentums.append(max_momentum)
-            max_speeds.append(max_speed)        
+            max_speeds.append(max_speed)     
             #### finished generating quantities for each swwfile #####
-
+        
         model_time_plot3d[:,:] = model_time[:,:,j]
         stages_plot3d[:,:] = stages[:,:,j]
@@ -922,12 +930,10 @@
                 ax = p3.Axes3D(fig)
                 if len(gauges) > 80:
-                    ax.plot_surface(eastings,model_time_plot3d,stages_plot3d)
-                    #ax.plot_surface(eastings[:,:,j],model_time[:,:,j],stages[:,:,j])
+                    ax.plot_surface(model_time[:,:,j],eastings[:,:,j],stages[:,:,j])
                 else:
-                    #ax.plot_wireframe(eastings[:,:,j],model_time[:,:,j],stages[:,:,j])
-                    ax.plot_wireframe(eastings,model_time_plot3d,stages_plot3d)
+                    ax.plot_wireframe(model_time[:,:,j],eastings[:,:,j],stages[:,:,j])
                     #ax.plot3D(ravel(eastings[:,:,j]),ravel(model_time[:,:,j]),ravel(stages[:,:,j]))
-                ax.set_xlabel('x')
-                ax.set_ylabel('time')
+                ax.set_xlabel('time')
+                ax.set_ylabel('x')
                 ax.set_zlabel('stage')
                 fig.add_axes(ax)
@@ -936,11 +942,20 @@
                 p1.savefig(surfacefig)
                 p1.close()
-        
+            
     #### finished generating quantities for all swwfiles #####
 
+    # x profile for given time
+    if surface == True:
+        figure(11)
+        plot(eastings[tindex,:,j],stages[tindex,:,j])
+        xlabel('x')
+        ylabel('stage')
+        profilefig = 'solution_xprofile' 
+        savefig('profilefig')
+                
     stage_axis = axis([time_min/60.0, time_max/60.0, min(min_stages), max(max_stages)*1.1])
     vel_axis = axis([time_min/60.0, time_max/60.0, min(max_speeds), max(max_speeds)*1.1])
-    mom_axis = axis([time_min/60.0, time_max/60.0, min(max_momentums), max(max_momentums)*1.1])
-
+    mom_axis = axis([time_min/60.0, time_max/60.0, min(max_momentums), max(max_momentums)*1.1])  
+    
     cstr = ['g', 'r', 'b', 'c', 'm', 'y', 'k']
     nn = len(plot_quantity)
@@ -1005,5 +1020,5 @@
                 xlabel('time (mins)')
                 ylabel('%s (%s)' %(which_quantity, units))
-                legend((leg_label),loc='upper right')
+                if len(label_id) > 1: legend((leg_label),loc='upper right')
 
                 gaugeloc1 = gaugeloc.replace(' ','')
@@ -1040,5 +1055,6 @@
                         else:
                             s = '& \n'
-                        fid.write(s)                        
+                        fid.write(s)
+                        savefig(graphname_latex)
                 
                 if title_on == True:
@@ -1055,7 +1071,7 @@
                     
                 word_quantity += ' and ' + plot_quantity[nn-1]                
-                caption = 'Time series for %s at %s gauge location (elevation %.2fm)' %(word_quantity, locations[k], elev[k]) #gaugeloc.replace('_',' '))
+                caption = 'Time series for %s at %s location (elevation %.2fm)' %(word_quantity, locations[k], elev[k]) #gaugeloc.replace('_',' '))
                 if elev[k] == 0.0:
-                    caption = 'Time series for %s at %s gauge location (elevation %.2fm)' %(word_quantity, locations[k], elevations[0,k,j])
+                    caption = 'Time series for %s at %s location (elevation %.2fm)' %(word_quantity, locations[k], elevations[0,k,j])
                     east = gauges[0]
                     north = gauges[1]
@@ -1090,7 +1106,7 @@
             word_quantity += ' and ' + plot_quantity[nn-1]            
             label = 'gauge%s' %(gaugeloc2) 
-            caption = 'Time series for %s at %s gauge location (elevation %.2fm)' %(word_quantity, locations[k], elev[k])
+            caption = 'Time series for %s at %s location (elevation %.2fm)' %(word_quantity, locations[k], elev[k])
             if elev[k] == 0.0:
-                    caption = 'Time series for %s at %s gauge location (elevation %.2fm)' %(word_quantity, locations[k], elevations[0,k,j])
+                    caption = 'Time series for %s at %s location (elevation %.2fm)' %(word_quantity, locations[k], elevations[0,k,j])
                     thisgauge = gauges[k]
                     east = thisgauge[0]
