def __init__(self, segment, y, height=.8, valign='center', **kwargs):
        """Build a `~matplotlib.patches.Rectangle` from a segment

        Parameters
        ----------
        segment : `~gwpy.segments.Segment`
            ``[start, stop)`` GPS segment

        y : `float`
            y-axis position for segment

        height : `float`, optional, default: 1
            height (in y-axis units) for segment

        valign : `str`
            alignment of segment on y-axis value:
                `top`, `center`, or `bottom`

        **kwargs
            any other keyword arguments acceptable for
            `~matplotlib.patches.Rectangle`

        Returns
        -------
        box : `~matplotlib.patches.Rectangle`
            rectangle patch for segment display
        """
        if valign.lower() == 'bottom':
            y0 = y
        elif valign.lower() in ['center', 'centre']:
            y0 = y - height/2.
        elif valign.lower() == 'top':
            y0 = y - height
        else:
            raise ValueError("valign must be one of 'top', 'center', or "
                             "'bottom'")
        width = segment[1] - segment[0]

        super(SegmentRectangle, self).__init__((segment[0], y0), width=width,
                                               height=height, **kwargs)
        self.segment = segment
def __init__ ( self , segment , y , height = .8 , valign = 'center' , ** kwargs ) : if valign . lower ( ) == 'bottom' : y0 = y elif valign . lower ( ) in [ 'center' , 'centre' ] : y0 = y - height / 2. elif valign . lower ( ) == 'top' : y0 = y - height else : raise ValueError ( "valign must be one of 'top', 'center', or " "'bottom'" ) width = segment [ 1 ] - segment [ 0 ] super ( SegmentRectangle , self ) . __init__ ( ( segment [ 0 ] , y0 ) , width = width , height = height , ** kwargs ) self . segment = segment
Build a `~matplotlib.patches.Rectangle` from a segment

        Parameters
        ----------
        segment : `~gwpy.segments.Segment`
            ``[start, stop)`` GPS segment

        y : `float`
            y-axis position for segment

        height : `float`, optional, default: 1
            height (in y-axis units) for segment

        valign : `str`
            alignment of segment on y-axis value:
                `top`, `center`, or `bottom`

        **kwargs
            any other keyword arguments acceptable for
            `~matplotlib.patches.Rectangle`

        Returns
        -------
        box : `~matplotlib.patches.Rectangle`
            rectangle patch for segment display