Search code examples
pythonmatplotlibseabornimage-resizing

Off-center X-Axis in Seaborn


I'm having an issue getting my boxplot to align with my x axis labels. I've tried adjusting the size of the chart, but the data points still look a little off. I appreciate any help!

This is the current chart:

Current Chart


Solution

  • I'm guessing it's because you're using two categorical variables; x, and hue. This creates a so called "nested" (search for the key-word "smoke") box-plot, and if one of the categories is empty in some sense, might cause the observed off-set.