# Why when using fig.update\_traces(xaxis='x1') doesn't print axis tick and labels bellow second subplot?

**URL:** <https://community.plotly.com/t/why-when-using-fig-update-traces-xaxis-x1-doesnt-print-axis-tick-and-labels-bellow-second-subplot/68062>\
**Category:** Dash Python\
**Created:** [September 18, 2022, 1:57pm UTC](https://community.plotly.com/t/why-when-using-fig-update-traces-xaxis-x1-doesnt-print-axis-tick-and-labels-bellow-second-subplot/68062 "2022-09-18T13:57:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![commongrackle](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@commongrackle](https://community.plotly.com/u/commongrackle)\
**Post date:** [February 11, 2025, 7:17am UTC](https://community.plotly.com/t/why-when-using-fig-update-traces-xaxis-x1-doesnt-print-axis-tick-and-labels-bellow-second-subplot/68062/2 "2025-02-11T07:17:03Z")

</div>

I get exactly the same issue in plotly v6.0.0.

Minimal working example:

```auto
import plotly.graph_objects as go
from plotly import data
from plotly.subplots import make_subplots

df = data.stocks()

fig = make_subplots(rows=2, cols=1, shared_xaxes=True)

fig.add_trace(go.Scatter(x=df["date"], y=df["AAPL"], name="A"), row=1, col=1)
fig.add_trace(go.Scatter(x=df["date"], y=df["GOOG"], name="B"), row=2, col=1)

fig.update_layout(hovermode="x unified") # allow hover (step 1)
fig.update_traces(xaxis="x1") # allow hover (step 2)
fig.for_each_xaxis(lambda x: x.update(showticklabels=True)) # tick labels are broken

fig.show()

```

Results:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/3/d/3df366ad634d88e7b5ad93202bc8bcd957b165da.png)

Attempts at resolving the issue by manually defining a grid in `fig.update_layout` (e.g.  
[this thread](https://community.plotly.com/t/hover-question-how-to-info-in-all-trace/84893/2)) does not work.

A workaround is to simply set `fig.update_traces(xaxis="x2")`, or whatever the last row is, but that is a poor solution for very long charts with many subplots, where it is impossible to see the tick labels of the bottom-most plot. It will also not work for subplots with multiple columns.

---

_[View the full topic](https://community.plotly.com/t/why-when-using-fig-update-traces-xaxis-x1-doesnt-print-axis-tick-and-labels-bellow-second-subplot/68062)._
