parameters: (self, ctx)
docstring: ! Draw 
          @param self this object
          @param ctx ctx
          @return none
docstring_summary: ! Draw
docstring_tokens: ! Draw
function: def draw(self, ctx):
          """! Draw 
          @param self this object
          @param ctx ctx
          @return none
          """
          delta = self.__delta
          start = self.__lo - (self.__lo % delta) + delta
          end = self.__hi - (self.__hi % delta)
  
          if self.__top == 1:
              s = -1
          else:
              s = 1
          # print scale points
          ctx.set_source_rgb(0, 0, 0)
          ctx.set_line_width(1.0)
          ticks = range(int(start), int(end + delta), int(delta))
          for x in ticks:
              real_x = (x - self.__lo ) * self.__width / (self.__hi - self.__lo)
              ctx.move_to(real_x, 0)
              ctx.line_to(real_x, 5*s)
              ctx.close_path()
              ctx.stroke()
              (t_y_bearing, t_width, t_height) = ctx.text_extents(str(x))[1:4]
              if self.__top:
                  text_delta = t_height + t_y_bearing
              else:
                  text_delta = -t_y_bearing
              ctx.move_to(real_x - t_width / 2, (5 + 5 + text_delta)*s)
              ctx.show_text(str(x))
          # draw subticks
          delta /= 10
          if delta > 0:
              start = self.__lo - (self.__lo % delta) + delta
              end = self.__hi - (self.__hi % delta)
              for x in range(int(start), int(end + delta), int(delta)):
                  real_x = (x - self.__lo ) * self.__width / (self.__hi - self.__lo)
                  ctx.move_to(real_x, 0)
                  ctx.line_to(real_x, 3*s)
                  ctx.close_path()
                  ctx.stroke()
function_tokens: def draw ( self , ctx ) : delta = self . __delta start = self . __lo - ( self . __lo % delta ) + delta end = self . __hi - ( self . __hi % delta ) if self . __top == 1 : s = - 1 else : s = 1 # print scale points ctx . set_source_rgb ( 0 , 0 , 0 ) ctx . set_line_width ( 1.0 ) ticks = range ( int ( start ) , int ( end + delta ) , int ( delta ) ) for x in ticks : real_x = ( x - self . __lo ) * self . __width / ( self . __hi - self . __lo ) ctx . move_to ( real_x , 0 ) ctx . line_to ( real_x , 5 * s ) ctx . close_path ( ) ctx . stroke ( ) ( t_y_bearing , t_width , t_height ) = ctx . text_extents ( str ( x ) ) [ 1 : 4 ] if self . __top : text_delta = t_height + t_y_bearing else : text_delta = - t_y_bearing ctx . move_to ( real_x - t_width / 2 , ( 5 + 5 + text_delta ) * s ) ctx . show_text ( str ( x ) ) # draw subticks delta /= 10 if delta > 0 : start = self . __lo - ( self . __lo % delta ) + delta end = self . __hi - ( self . __hi % delta ) for x in range ( int ( start ) , int ( end + delta ) , int ( delta ) ) : real_x = ( x - self . __lo ) * self . __width / ( self . __hi - self . __lo ) ctx . move_to ( real_x , 0 ) ctx . line_to ( real_x , 3 * s ) ctx . close_path ( ) ctx . stroke ( )