# Multi-level = False with Line Overlay

**URL:** <https://discourse.holoviz.org/t/multi-level-false-with-line-overlay/7534>\
**Category:** hvPlot\
**Tags:** bars\
**Created:** [August 3, 2024, 1:45am UTC](https://discourse.holoviz.org/t/multi-level-false-with-line-overlay/7534 "2024-08-03T01:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mich](https://discourse.holoviz.org/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@mich](https://discourse.holoviz.org/u/mich)\
**Post date:** [August 3, 2024, 1:45am UTC](https://discourse.holoviz.org/t/multi-level-false-with-line-overlay/7534/1 "2024-08-03T01:45:50Z")

</div>

Hello!

I’m plotting a multiindex dataframe with two levels of indices, I only wanted one of them to show up and this command worked perfectly `.opts(multi_level=False)`. However, the moment I overlayed the plot with a horizontal line using `good_plot *= hv.HLine(line_height)`, the original multilevel x axis would come back. Is there a way around this? Here’s a toy example:

```auto
toy_csv = pd.read_csv("toy.csv", index_col=[0, 1]).rename_axis(index=["category", "df"])
plot_mean = np.mean(toy_csv['hours_of_data'])

toy_plot = toy_csv.hvplot.bar(
    y="hours_of_data",
    by="df",
    stacked=False,
    legend=False,
    rot=XROTATION,
    color=["#1F77B4", "#FF7F0E"],
).opts(
    xlabel="",
    shared_axes=False,
    show_grid=True,
    width=PLOT_WIDTH,
    multi_level=False,
    show_legend=True,
    legend_position = 'top_right'
)
toy_plot

```

Would produce image 1. But if a horizontal line is added as an overlay plot:

```auto
toy_plot *= hv.HLine(plot_mean).opts(
    color="#1F77B4",
    line_dash="dashed",
    line_width=1,
)
toy_plot

```

It would revert back to the multi-level x axis (image 2), which isn’t what I want. Any ideas on how to keep it the same? The toy example csv structure is included below as image 3 (for some reason new users can’t add attachments and can only add 1 picture? I just used random numbers)

 ![Screenshot 2024-08-02 at 6.44.48 PM](https://discourse.holoviz.org/uploads/default/original/2X/1/110c6007759f9974093a03b8e0435b33724dbda5.jpeg)

Thank you so much!

---

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [August 3, 2024, 4:47am UTC](https://discourse.holoviz.org/t/multi-level-false-with-line-overlay/7534/2 "2024-08-03T04:47:36Z")

</div>

Maybe adding `Bars`; if not it’s likely a bug

```python

toy_plot = toy_csv.hvplot.bar(
    y="hours_of_data",
    by="df",
    stacked=False,
    legend=False,
    rot=XROTATION,
    color=["#1F77B4", "#FF7F0E"],
).opts(
    "Bars",
    xlabel="",
    shared_axes=False,
    show_grid=True,
    width=PLOT_WIDTH,
    multi_level=False,
    show_legend=True,
    legend_position = 'top_right'
)
```
