# plot_lanes

<table class=".origin_table">
    <tr>
        <td style="text-align: left; border-style: hidden">*function*  of [dascore.viz._lanes](`dascore.viz._lanes`)</td>
        <td style="text-align: right; border-style: hidden">[source](https://github.com/DASDAE/dascore/blob/dev/dascore/viz/_lanes.py#L326-L554)</td>
    </tr>
</table>

:::{.padded_bottom_10pt}

:::{.def_block}


<b>plot_lanes</b>(<br>
    &nbsp;&nbsp;&nbsp;&nbsp;intervals
,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;ax: matplotlib.axes._axes.Axes | None[Axes, None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;start: str
 = start,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;end: str
 = end,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;lane: str | None[str, None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;value: str | None[str, None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;label: str | None[str, None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;lanes: collections.abc.Sequence[collections.abc.Sequence[str], None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;color
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;vocabulary: collections.abc.Sequence | None[Sequence, None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;pack: bool
 = True,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;legend: bool | str[bool, str]
 = auto,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;max_labels: int
 = 200,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;x_limits: tuple | None[<class 'tuple, None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;x_label: str
 = "",<br>
    &nbsp;&nbsp;&nbsp;&nbsp;lane_height: float
 = 0.8,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;colorbar_axes: collections.abc.Sequence[collections.abc.Sequence[Axes], None]
 = None,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;show: bool
 = False,<br>
)-> 'plt.Axes'


:::

:::
Draw a frame of intervals as horizontal lanes.

## Parameters

<table class="table">
  <thead>
    <tr>
            <th scope="col"> Parameter</th>
            <th scope="col"> Description</th>
    </tr>
  </thead>
  <tbody>
        <tr>
            <td>intervals</td>
            <td>A dataframe with one row per interval.</td>
        </tr>
        <tr>
            <td>ax</td>
            <td>A matplotlib Axes; one is created when None.</td>
        </tr>
        <tr>
            <td>start, end</td>
            <td>Columns holding the interval bounds. They may be numbers or<br>datetimes, and equal bounds make the row a point marker.</td>
        </tr>
        <tr>
            <td>lane</td>
            <td>Column naming the lane a row belongs to; None puts every row in<br>one unnamed lane.</td>
        </tr>
        <tr>
            <td>value</td>
            <td>Column deciding each row's color. Strings are categorical,<br>numbers continuous, and a row with no value states membership<br>of the lane (true and false are not values; an interval outside<br>the lane has no row).</td>
        </tr>
        <tr>
            <td>label</td>
            <td>Column holding the text drawn in each box. Values supply it by<br>default: text as itself, a number as its digits, and a row which<br>states no value nothing, since its lane already names it.</td>
        </tr>
        <tr>
            <td>lanes</td>
            <td>The lanes to draw, in order. Names with no rows are kept as empty<br>lanes, so two figures of different subjects still line up.</td>
        </tr>
        <tr>
            <td>color</td>
            <td>A color for every row, a mapping of value to color, or a mapping<br>of lane name to such a mapping. A lane whose values are numbers<br>reads a color string as the name of a colormap, or as a color<br>where it names no colormap.</td>
        </tr>
        <tr>
            <td>vocabulary</td>
            <td>Values to reserve colors for beyond those this frame holds, so a<br>figure of part of a subject colors it as a figure of all of it.</td>
        </tr>
        <tr>
            <td>pack</td>
            <td>Whether overlapping intervals are packed into sub-rows.</td>
        </tr>
        <tr>
            <td>legend</td>
            <td>Whether to draw a legend and any colorbars. False, or "off",<br>draws neither; anything else draws what the colors earn.</td>
        </tr>
        <tr>
            <td>max_labels</td>
            <td>Draw no text at all past this many intervals.</td>
        </tr>
        <tr>
            <td>x_limits</td>
            <td>Limits for the x axis, in data units.</td>
        </tr>
        <tr>
            <td>x_label</td>
            <td>Label for the x axis.</td>
        </tr>
        <tr>
            <td>lane_height</td>
            <td>Fraction of a lane's row filled by its bars.</td>
        </tr>
        <tr>
            <td>colorbar_axes</td>
            <td>The axes a colorbar takes its room from; the drawn axes alone by<br>default. Pass every axes of a shared-x figure, or the others keep<br>a width this one gives up.</td>
        </tr>
        <tr>
            <td>show</td>
            <td>Whether to call plt.show.</td>
        </tr>
  </tbody>
</table>

## Examples
```{python}
import pandas as pd
from dascore.viz._lanes import plot_lanes

frame = pd.DataFrame(
    {
        "group": ["zone", "zone", "noisy"],
        "start": [0.0, 10.0, 5.0],
        "end": [10.0, 20.0, 15.0],
        "value": ["north", "south", None],
    }
)
_ = plot_lanes(frame, lane="group", value="value")
```

