Index: /issm/trunk-jpl/src/m/plot/plotmodel.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 26181)
+++ /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 26182)
@@ -14,5 +14,5 @@
 def plotmodel(md, *args):
     '''
-    PLOTMODEL - At command prompt, type 'plotdoc()' for additional 
+    PLOTMODEL - At command prompt, type 'plotdoc()' for additional
     documentation.
 
@@ -31,5 +31,5 @@
     subplotwidth = ceil(sqrt(numberofplots))
 
-    # TODO: Check that commenting this out is correct; we do not need a hold 
+    # TODO: Check that commenting this out is correct; we do not need a hold
     # under matplotlib, right?
     #
@@ -40,25 +40,22 @@
     if options.list[0].exist('nrows'):
         nrows = options.list[0].getfieldvalue('nrows')
-        nr = True
     else:
-        nrows = np.ceil(numberofplots / subplotwidth)
-        nr = False
+        if options.list[0].exist('ncols'):
+            ncols = options.list[0].getfieldvalue('ncols')
+            nrows = np.ceil(numberofplots / ncols)
+        else:
+            nrows = np.ceil(numberofplots / subplotwidth)
 
     if options.list[0].exist('ncols'):
         ncols = options.list[0].getfieldvalue('ncols')
-        nc = True
+        nrows = np.ceil(numberofplots / ncols)
     else:
         ncols = int(subplotwidth)
-        nc = False
     ncols = int(ncols)
     nrows = int(nrows)
 
-    #check that nrows and ncols were given at the same time!
-    if nr != nc:
-        raise Exception('plotmodel error message: nrows and ncols need to be specified together, or not at all')
-
     # Go through plots
     #
-    # NOTE: The following is where Python + matplolib differs substantially in 
+    # NOTE: The following is where Python + matplolib differs substantially in
     #       implementation and inteface from MATLAB.
     #
@@ -83,17 +80,17 @@
             plotnum = None
 
-        # NOTE: The inline comments for each of the following parameters are 
+        # NOTE: The inline comments for each of the following parameters are
         #       taken from https://matplotlib.org/api/_as_gen/mpl_toolkits.axes_grid1.axes_grid.ImageGrid.html
         #
-        direction = options.list[0].getfieldvalue('direction', 'row') # {"row", "column"}, default: "row"
-        axes_pad = options.list[0].getfieldvalue('axes_pad', 0.25) # float or (float, float), default : 0.02; Padding or (horizonal padding, vertical padding) between axes, in inches
-        add_all = options.list[0].getfieldvalue('add_all', True) # bool, default: True
-        share_all = options.list[0].getfieldvalue('share_all', True) # bool, default: False
-        label_mode = options.list[0].getfieldvalue('label_mode', 'L') # {"L", "1", "all"}, default: "L"; Determines which axes will get tick labels: "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels;. "1": Only the bottom left axes is labelled. "all": all axes are labelled.
+        direction = options.list[0].getfieldvalue('direction', 'row')  # {"row", "column"}, default: "row"
+        axes_pad = options.list[0].getfieldvalue('axes_pad', 0.25)  # float or (float, float), default : 0.02; Padding or (horizonal padding, vertical padding) between axes, in inches
+        add_all = options.list[0].getfieldvalue('add_all', True)  # bool, default: True
+        share_all = options.list[0].getfieldvalue('share_all', True)  # bool, default: False
+        label_mode = options.list[0].getfieldvalue('label_mode', 'L')  # {"L", "1", "all"}, default: "L"; Determines which axes will get tick labels: "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels;. "1": Only the bottom left axes is labelled. "all": all axes are labelled.
 
         # Translate MATLAB colorbar mode to matplotlib
         #
         # TODO:
-        # - Add 'edge' option (research if there is a corresponding option in 
+        # - Add 'edge' option (research if there is a corresponding option in
         #   MATLAB)?
         #
@@ -109,8 +106,8 @@
             raise RuntimeError('plotmodel error: colorbar mode \'{}\' is not a valid option'.format(colorbar))
 
-        cbar_mode = colorbar # {"each", "single", "edge", None }, default: None
-        cbar_location = options.list[0].getfieldvalue('colorbarpos', 'right') # {"left", "right", "bottom", "top"}, default: "right"
-        cbar_pad = options.list[0].getfieldvalue('colorbarpad', 0.025) # float, default: None
-        cbar_size = options.list[0].getfieldvalue('colorbarsize', '5%') # size specification (see Size.from_any), default: "5%"
+        cbar_mode = colorbar   # {"each", "single", "edge", None }, default: None
+        cbar_location = options.list[0].getfieldvalue('colorbarpos', 'right')   # {"left", "right", "bottom", "top"}, default: "right"
+        cbar_pad = options.list[0].getfieldvalue('colorbarpad', 0.025)  # float, default: None
+        cbar_size = options.list[0].getfieldvalue('colorbarsize', '5%')  # size specification (see Size.from_any), default: "5%"
 
         # NOTE: Second parameter is:
@@ -118,5 +115,5 @@
         #   rect(float, float, float, float) or int
         #
-        # The axes position, as a (left, bottom, width, height) tuple or as a 
+        # The axes position, as a (left, bottom, width, height) tuple or as a
         # three-digit subplot position code (e.g., "121").
         #
