(self, strip_length, strip_width, orientation=Qt.Horizontal)
return img
Return a pixmap of given dimensions to be used for legends.

        Args:
            strip_length (int): length of the strip; may be horizontal or vertical
            strip_width (int): width of the strip
            orientation: strip orientation

        Returns:
            QPixmap with a strip
Return a pixmap of given dimensions to be used for legends.
Return a pixmap of given dimensions to be used for legends .
def color_strip(self, strip_length, strip_width, orientation=Qt.Horizontal):
        """
        Return a pixmap of given dimensions to be used for legends.

        Args:
            strip_length (int): length of the strip; may be horizontal or vertical
            strip_width (int): width of the strip
            orientation: strip orientation

        Returns:
            QPixmap with a strip
        """
        points = np.linspace(0, 255, strip_length, dtype=np.uint8)
        section = self.palette[np.newaxis, points, :].astype(np.ubyte)
        img = np.vstack((section,) * strip_width)
        if orientation == Qt.Horizontal:
            width, height = strip_length, strip_width
        else:
            width, height = strip_width, strip_length
            img = img.swapaxes(0, 1)[::-1].copy()
        pad_width = (-img.strides[1]) % 4
        if pad_width:
            padding = np.zeros((img.shape[0], pad_width, 3), np.ubyte)
            img = np.hstack((img, padding))
        img = QImage(img, width, height, img.strides[0], QImage.Format_RGB888)
        img = QPixmap.fromImage(img)
        return img
def color_strip ( self , strip_length , strip_width , orientation = Qt . Horizontal ) : points = np . linspace ( 0 , 255 , strip_length , dtype = np . uint8 ) section = self . palette [ np . newaxis , points , : ] . astype ( np . ubyte ) img = np . vstack ( ( section , ) * strip_width ) if orientation == Qt . Horizontal : width , height = strip_length , strip_width else : width , height = strip_width , strip_length img = img . swapaxes ( 0 , 1 ) [ : : - 1 ] . copy ( ) pad_width = ( - img . strides [ 1 ] ) % 4 if pad_width : padding = np . zeros ( ( img . shape [ 0 ] , pad_width , 3 ) , np . ubyte ) img = np . hstack ( ( img , padding ) ) img = QImage ( img , width , height , img . strides [ 0 ] , QImage . Format_RGB888 ) img = QPixmap . fromImage ( img ) return img