diff --git a/yt/visualization/volume_rendering/transfer_functions.py b/yt/visualization/volume_rendering/transfer_functions.py index b1140ca7af..4491fc4f5d 100644 --- a/yt/visualization/volume_rendering/transfer_functions.py +++ b/yt/visualization/volume_rendering/transfer_functions.py @@ -787,7 +787,7 @@ def map_to_colormap( self.nbins * (ma - self.x_bounds[0]) / (self.x_bounds[1] - self.x_bounds[0]) ) rel0 = max(rel0, 0) - rel1 = min(rel1, self.nbins - 1) + rel1 = min(rel1, self.nbins - 1) + 1 tomap = np.linspace(0.0, 1.0, num=rel1 - rel0) cmap = get_cmap(colormap) cc = cmap(tomap)