@@ -1044,9 +1044,14 @@ def __call__(self, value, clip=None):
1044
1044
raise ValueError ("data points must increase monotonically" )
1045
1045
ind = np .where ((self ._data_points >= vmin ) &
1046
1046
(self ._data_points <= vmax ))[0 ]
1047
+ if clip == None :
1048
+ left , right = - 1 , 2
1049
+ else :
1050
+ left , right = 0 , 1
1047
1051
result = np .ma .masked_array (np .interp (result ,
1048
1052
self ._data_points [ind ],
1049
- self ._norm_points [ind ]),
1053
+ self ._norm_points [ind ],
1054
+ left = left , right = right ),
1050
1055
mask = np .ma .getmask (result ))
1051
1056
if is_scalar :
1052
1057
result = np .atleast_1d (result )[0 ]
@@ -1139,12 +1144,11 @@ def __init__(self, vmin=None, vcenter=None, vmax=None):
1139
1144
# will autoscale to data.
1140
1145
self .vmin = vmin
1141
1146
self .vmax = vmax
1142
- if vcenter is not None and vmax is not None and vcenter > vmax :
1143
- raise ValueError ('vmin, vcenter, and vmax must be in '
1144
- 'ascending order' )
1145
- if vcenter is not None and vmin is not None and vcenter < vmin :
1146
- raise ValueError ('vmin, vcenter, and vmax must be in '
1147
- 'ascending order' )
1147
+ if vcenter is not None :
1148
+ if ((vmax is not None and vcenter > vmax ) or
1149
+ (vmin is not None and vcenter < vmin )):
1150
+ raise ValueError ('DivergingNorm requires that '
1151
+ 'vmin < vcenter < vmax' )
1148
1152
1149
1153
def __call__ (value , clip = None ):
1150
1154
"""
0 commit comments