daattali / ggExtra

📊 Add marginal histograms to ggplot2, and more ggplot2 enhancements
http://daattali.com/shiny/ggExtra-ggMarginal-demo/
Other
383 stars 48 forks source link

Variable boxplot size and order #174

Closed ga01 closed 1 year ago

ga01 commented 1 year ago

Hi, Great package; I found a weird behaviour with boxplots, it seems that their size and order can vary, even when the same factors are plotted on different figures. I did not find a way of changing this behaviour; is there a way of switching off this feature, and having similarly sized and ordered boxes?

Best wishes, George

img1 img2

daattali commented 1 year ago

@ga01 is this a duplicate of https://github.com/daattali/ggExtra/issues/169 ? That was just fixed last week, please try installing the latest version from github and see if it's fixed for you.

ga01 commented 1 year ago

Hi Yes, it was largely the same problem, I should have found it myself. Installing the latest ggExtra version fixes most issues, there is one minor issue that remains: the order of the boxes is not the same as the order of the factors on the main plot, at least when there are three factors (probably with more as well). So if I have three factors, A, B and C, then the order of the boxes in the side-boxplot is B, A, C. It is consistent across different plots with the same factors, the color-coding is correct, so this is not an error just a minor cosmetic issue, but still might be worth fixing.

Best wishes, George

daattali commented 1 year ago

If this issue is fixed, I'm closing this issue. Please open a separate issue for the other problem you describe!