Skip to content

Commit

Permalink
Backport PR yt-project#3661: BUG: fix an off-by-one error in ColorTra…
Browse files Browse the repository at this point in the history
…nsferFunction.to_map_colormap method
  • Loading branch information
matthewturk authored and meeseeksmachine committed Nov 10, 2021
1 parent 71699c4 commit 570c16a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yt/visualization/volume_rendering/transfer_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 570c16a

Please sign in to comment.