~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to chaco/color_bar.py

  • Committer: Package Import Robot
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2014-06-01 17:04:08 UTC
  • mfrom: (7.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20140601170408-m86xvdjd83a4qon0
Tags: 4.4.1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
 - Let the binary-predeb target work on the usr/lib/python* directory
   as we don't have usr/share/pyshared anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from __future__ import with_statement
5
5
 
6
6
# Major library imports
7
 
from numpy import array, arange, ones, transpose, uint8
 
7
from numpy import array, arange, ascontiguousarray, ones, transpose, uint8
8
8
 
9
9
# Enthought library imports
10
10
from traits.api import Any, Bool, Enum, Instance, Property, \
170
170
                                    color_values.shape[1]))* color_values * 255
171
171
 
172
172
        if orientation == "v":
173
 
            bmparray = transpose(bmparray, axes=(1,0,2))[::-1]
 
173
            bmparray = ascontiguousarray(transpose(bmparray, axes=(1,0,2))[::-1])
174
174
        bmparray = bmparray.astype(uint8)
175
175
        img = GraphicsContext(bmparray, "rgba32")
176
176
        return img