Changeset 9691


Ignore:
Timestamp:
Feb 25, 2015, 9:50:59 AM (9 years ago)
Author:
davies
Message:

Another fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/anuga/utilities/plot_utils.py

    r9690 r9691  
    11801180        all_poly.set_facecolor('none')
    11811181    else:
    1182         msg = 'len(values) must either be 1, or the same as len(p.vols)'
    1183         assert len(values)==len(p.vols), msg
     1182        try:
     1183            lv = len(values)
     1184        except:
     1185            values = numpy.array(len(p.vols)*[values])
     1186            lv = len(values)
     1187
     1188        msg = 'len(values) must be the same as len(p.vols) (or values can be a constant)'
     1189        assert lv==len(p.vols), msg
    11841190        all_poly = PolyCollection( vertices, array = values, cmap = values_cmap,
    11851191            edgecolors=edgecolors)
Note: See TracChangeset for help on using the changeset viewer.