plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Boxplot Category Cutoff Issues

Open lswainemoore opened this issue 11 months ago • 3 comments

Hi--I've got a boxplot I want to show all options of a category array on, regardless of whether data is present. For the purposes of demonstration, let's consider the categories to be days of the week, and it's important that the user be able to see if a day of the week is missing data.

I can use category array to get missing boxes that fall in the middle of the data to appear, but entries at the start / end won't show up:

Image

I can specify a manual range (in terms of the indexes per docs), but then the boxes get cut off awkwardly (same thing would happen on the right if Sunday was present):

Image

This gets even worse when there are multiple traces (in this case a full box from one trace is cut off):

Image

The only way I see to resolve this is to use negative indexes (or extra indexes if the issue is on the right side), but that doesn't seem very future proof (since it bucks the docs), and sits a bit awkwardly.

Image

Is there a better way to do this?

Here's a codepen reproducing the graphs I used here: https://codepen.io/lswainemoore/pen/yyLOdbo.

Thanks for any help!

lswainemoore avatar Feb 22 '25 03:02 lswainemoore

Hi - we are trying to keep the issues and PRs in Plotly's public repositories tidy so that we can focus on things that are most important to our community. For tech support and "how-to" questions, please post in our community forum https://community.plotly.com/. Thank you - @gvwilson

gvwilson avatar Feb 24 '25 16:02 gvwilson

@gvwilson sorry for the delay in following up here, but I really don't think this is a "how-to", though I suppose I was couching it that way. It seems like a bug that with these box plots, objects get cut off by the axes (in particularly in the example where a full box is missing). If it's out of scope, I understand, but want to make sure it's flagged.

lswainemoore avatar Apr 15 '25 00:04 lswainemoore

thanks @lswainemoore - reopening

gvwilson avatar Apr 16 '25 14:04 gvwilson