Skip to content

Should categorical bars / boxes always have a width of 1? #1181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bpostlethwaite opened this issue Nov 21, 2016 · 5 comments · Fixed by #5072
Closed

Should categorical bars / boxes always have a width of 1? #1181

bpostlethwaite opened this issue Nov 21, 2016 · 5 comments · Fixed by #5072
Assignees
Labels
bug something broken

Comments

@bpostlethwaite
Copy link
Member

bpostlethwaite commented Nov 21, 2016

http://codepen.io/bpostlethwaite/pen/eBvMWM

All data points except two have been filtered but the plot shows the full range of axis points and they are off center. I don't know if this is related to filtering or is more general but this is a way to trigger it.

cc @etpinard @alexcjohnson

@bpostlethwaite bpostlethwaite added the bug something broken label Nov 21, 2016
@alexcjohnson
Copy link
Collaborator

that's a funny one, I think it's two bugs:

  • the categories are being read from the original trace, pre-filtering, which doesn't seem like what we want
  • then when we make bars only at a and f they each get a width of 5 categories - also probably not what we want, category axis bars should always have width 1 (one category), right? You can also trigger this second one with two overlaid traces:
Plotly.newPlot(gd,[
        {x:['a','b','c','d','e'], y:[1,2,3,4,5], type: 'bar'},
        {x:['a','e'], y:[4,2], type:'bar'}
    ],
    {barmode:'overlay'})

screen shot 2016-11-21 at 4 11 41 pm

@n-riesco
Copy link
Contributor

@alexcjohnson Forcing a width of 1 for category axis can be done by changing this line and this line.

@etpinard
Copy link
Contributor

etpinard commented Jan 4, 2017

the categories are being read from the original trace, pre-filtering, which doesn't seem like what we want

Fixed in #1260

Changing issue title to reflect what's left of @bpostlethwaite 's bug report.

@etpinard etpinard changed the title Bar axes bug after filter (may not be filter related) Should categorical bars always have a width of 1? Jan 4, 2017
@alexcjohnson
Copy link
Collaborator

Should categorical bars always have a width of 1?

I think so - it's misleading otherwise, as otherwise a bar would bleed into neighboring categories, which in principle have no relation to each other.

@etpinard
Copy link
Contributor

A similar problem happens for box traces on categorical position axes - see #4510 for more details.

@etpinard etpinard changed the title Should categorical bars always have a width of 1? Should categorical bars / boxes always have a width of 1? Jan 28, 2020
@archmoj archmoj removed this from the v2.0.0 milestone Aug 14, 2020
@archmoj archmoj added bug something broken and removed status: discussion needed labels Aug 14, 2020
@archmoj archmoj self-assigned this Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants