plotly / plotly/plotly.py

Polar barplots do not have reset zoom available

Open
#3,889 1 comment 0 reactions 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

I'm creating polar barplots to visualize angular histograms. These plots do have a zoom option in the modebar, but not a resetScale or zoomout. So I can zoom in, but there is no way to zoom out again.

Trying to add these buttons explicitly doesn't work. The modebar_add function does not throw an error, but no buttons are added either.

import plotly.graph_objects as go
import numpy as np

fig = go.Figure()

bins = np.linspace(0,358,180)
arr = np.array(bins)

series = [90+20*np.random.normal() for _ in np.arange(100)]

count, division = np.histogram(series, bins=bins)

fig.add_trace(go.Barpolar(
    r=count,
    theta=series,
    width=1,
    marker_line_width=2,
    opacity=0.5,
    base=0
))

fig.update_layout(
    title='Polar histogram',
    width=1000,
    height=1000,
    template=None,
    polar = dict(
        angularaxis = dict(showticklabels=True,
                           ticks='',
                           ),
    ),
    modebar_add=['resetScale',
                 'zoomout'],
)


fig.show()

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 Python reproduction and inspect how modebar actions are exposed for polar barplots, especially resetScale and zoomout. Confirm the expected behavior for zooming and resetting, then add or update the relevant regression coverage so both buttons work for this plot type.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, 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.