Changeset db6e599 in fipy


Ignore:
Timestamp:
09/12/14 23:45:09 (5 months ago)
Author:
Daniel Wheeler <daniel.wheeler2@…>
Branches:
ticket672-matplotlib-1_4_0-error
Parents:
08d564f
Message:

Bug with Matplotliv 1.4.0 is fixed

Fix ticket:672

Bug with Matplotlib version 1.4.0 is fixed. the bug was caused because
the default value of vmin and vmax is None internally to
Matplotlib. Some code in matplotlib tries a numpy operation on these
None values. A simple fix is to pass a norm instance to the
ColorbarBase? class when it is called in FiPy. This may be an internal
bug to Matplotlib.

The fix works was tried with both Matplotlib version 1.4.0 and 1.3.1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fipy/viewers/matplotlibViewer/matplotlibViewer.py

    r50dd6ad rdb6e599  
    193193        # following gives a basic continuous colorbar with ticks 
    194194        # and labels. 
    195         self._cb = matplotlib.colorbar.ColorbarBase(cbax, cmap=viewer.cmap, 
     195        import matplotlib.colors as colors 
     196        norm = colors.Normalize(vmin=vmin, vmax=vmax) 
     197        self._cb = matplotlib.colorbar.ColorbarBase(cbax, norm=norm, cmap=viewer.cmap, 
    196198                                                    orientation=orientation) 
    197199        self._cb.set_label(viewer.vars[0].name) 
Note: See TracChangeset for help on using the changeset viewer.