plotly / plotly/plotly.py

xaxis labels/ticklabels missing from the last columns in charts using facet_col_wrap

Open
#2,869 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

E.g in the below example the number of facets is not divisible by the number of columns and the bottom row isn't filled up but the xaxes in the bottom row are the only ones where the title is included and where showticklabels isn't set to False.

import plotly.express as px
df = px.data.tips()
fig = px.histogram(df, x="total_bill", y="tip", color="sex", facet_col="day", facet_col_wrap=3,
       category_orders={"day": ["Thur", "Fri", "Sat", "Sun"], "time": ["Lunch", "Dinner"]})
fig.show()

Screenshot from 2020-10-30 17-38-31

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 running the supplied px.histogram example with facet_col_wrap=3 and inspect the generated facet x-axis settings. Trace how the incomplete bottom row is handled when the facet count is not divisible by the column count. Done means the bottom-row axes retain their title and show tick labels consistently with the other facets.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.