def __init__(self, segment, y, height=<NUM_LIT>, valign='<STR_LIT>', **kwargs):
if valign.lower() == '<STR_LIT>':<EOL><INDENT>y0 = y<EOL><DEDENT>elif valign.lower() in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>y0 = y - height/<NUM_LIT><EOL><DEDENT>elif valign.lower() == '<STR_LIT>':<EOL><INDENT>y0 = y - height<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>width = segment[<NUM_LIT:1>] - segment[<NUM_LIT:0>]<EOL>super(SegmentRectangle, self).__init__((segment[<NUM_LIT:0>], y0), width=width,<EOL>height=height, **kwargs)<EOL>self.segment = segment<EOL>
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