# Repeat the x axis labels under each subplot

**URL:** <https://community.plotly.com/t/repeat-the-x-axis-labels-under-each-subplot/92025>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [April 25, 2025, 3:41pm UTC](https://community.plotly.com/t/repeat-the-x-axis-labels-under-each-subplot/92025 "2025-04-25T15:41:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wabiloo](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/wabiloo/32/8483_2.png) [@Wabiloo](https://community.plotly.com/u/Wabiloo)\
**Post date:** [April 25, 2025, 3:41pm UTC](https://community.plotly.com/t/repeat-the-x-axis-labels-under-each-subplot/92025/1 "2025-04-25T15:41:15Z")

</div>

I seem to have an issue with a figure with subplots.

I have a script that generates traces, assigns them to subplots and then generates the graph with make\_subplot.  
It generates a graph like the following:

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

I would like to have the x axis labels (with time) repeated below each subplot.  
I therefore followed the advice in [Subplots with shared x-axes BUT show x-axis for each plot - #2 by empet](https://community.plotly.com/t/subplots-with-shared-x-axes-but-show-x-axis-for-each-plot/34800/2) and ensured that I have `showticklabels=True` on every xaxis.

Yet, nothing works, and the tick labels still only appear on the bottom subplot.

Here is a (shortened) version of the code:

```auto
@dataclass
class SubplotInfo:
    traces: list[go.Bar]
    categories: list[str]
    title: str

def _create_figure_with_subplots(subplots: list[SubplotInfo]):
    """Create a figure with subplots from a list of subplots"""
    fig = make_subplots(
        rows=len(subplots),
        cols=1,
        shared_xaxes=True,
        subplot_titles=[s.title for s in subplots],
        vertical_spacing=0.1,
    )

    for i, subplot in enumerate(subplots):
        for trace in subplot.traces:  
            fig.add_trace(trace, row=i + 1, col=1)

        # Set y-axis labels
        fig.update_yaxes(
            tickvals=subplot.categories,
            ticktext=subplot.categories,
            title_text="",
            autorange="reversed",
            row=i + 1,
            col=1,
        )

        # Set x-axis as date/time
        fig.update_xaxes(
            type="date",
            title_text="",
            showticklabels=True,
            showspikes=True,
            spikemode="across",
            showline=True,
            spikesnap="cursor",
            spikedash="solid",
            spikethickness=1,
            spikecolor="gray",
            rangeslider=dict(visible=(i == len(subplots) - 1), thickness=0.05),
            row=i + 1,
            col=1,
        )

    # once more, for good measure...
    fig.update_xaxes(showticklabels=True)

    # Set layout
    fig.update_layout(
        barmode="stack",
        legend=dict(groupclick="toggleitem"),
        hovermode="closest",
        hoversubplots="axis"
    )

    # Force a single xaxis to allow spike lines to span all subplots
    fig.update_traces(xaxis=f"x{len(subplots)}")

    return fig

```

What I don’t understand is that when I examine `fig` on the last line, I can clearly see that xaxis1, xaxis2 and xaxis3 all have `showticklabels` set to True…

---

<div class="post-metadata">

**Author:** ![natatsypora](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/natatsypora/32/29839_2.png) [@natatsypora](https://community.plotly.com/u/natatsypora)\
**Post date:** [April 25, 2025, 7:29pm UTC](https://community.plotly.com/t/repeat-the-x-axis-labels-under-each-subplot/92025/2 "2025-04-25T19:29:52Z")

</div>

You can try to change` shared_xaxes=False`
