diff --git a/chaco/color_bar.py b/chaco/color_bar.py index dd120b9b8..8aaff3094 100644 --- a/chaco/color_bar.py +++ b/chaco/color_bar.py @@ -140,7 +140,11 @@ def _draw_plot(self, gc, view_bounds=None, mode='normal'): mapper = self.index_mapper - scrn_points = arange(mapper.low_pos, mapper.high_pos+1) + low = mapper.low_pos + high = mapper.high_pos + if self.direction == 'flipped': + low, high = high, low + scrn_points = arange(low, high + 1) # Get the data values associated with the list of screen points. if mapper.range.low == mapper.range.high: @@ -150,9 +154,6 @@ def _draw_plot(self, gc, view_bounds=None, mode='normal'): else: data_points = mapper.map_data(scrn_points) - if self.direction == 'flipped': - data_points = data_points[::-1] - # Get the colors associated with the data points. colors = self.color_mapper.map_screen(data_points)