plotly / plotly/plotly.py

fig.update_layout(xaxis_type="category") breaks make_subplots(shared_xaxes=True)

Open
#4,838 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

This one is pretty simple to explain and see. Create a subplot with two or more plots that are using the same x-axis data, enable shared_xaxes=True, plot it, and it works as intended; zooming in on one plot zooms in on both plots.

When updating the layout to xaxis_type="category", for categorical data, even when both both subplots have the same x-axis data and shared_xaxes=True is set to true, it no longer works; the axis are no longer shared. Zooming in on one plot no longer effects the other plot.

Tested on: plotly 5.24.1, python 3.13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported subplot case with make_subplots(shared_xaxes=True), categorical x-axis data, and xaxis_type="category". Compare zoom behavior before and after the layout update; done means zooming one subplot also zooms the other when the x-axis data is shared.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.