#NEWLINE# def _on_paint( self , event = None ) : #NEWLINE# #INDENT# if ( self . cmap is None ) : #NEWLINE# #INDENT# data = N . zeros ( ( self . width , self . height , 3 ) , dtype = N . uint8 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mapper = self . cmap ( DataRange1D ( low = 0 , high = ( self . width - 1 ) ) ) #NEWLINE# clrarray = ( mapper . map_screen ( N . arange ( 0 , self . width ) ) [ : , : ( - 1 ) ] * 255 ) #NEWLINE# data = N . require ( N . tile ( clrarray , ( self . height , 1 ) ) , dtype = N . uint8 , requirements = [ 'C_CONTIGUOUS' , 'ALIGNED' ] ) #NEWLINE# #UNINDENT# wdc = wx . PaintDC ( self ) #NEWLINE# ( wdx , wdy ) = self . GetClientSizeTuple ( ) #NEWLINE# bitmap = wx . BitmapFromBuffer ( self . width , self . height , data ) #NEWLINE# wdc . DrawBitmap ( bitmap , ( ( wdx - self . width ) / 2 ) , ( ( wdy - self . height ) / 2 ) )