This is the Seaborn Doc on how to make a horizontal boxplot. You'll notice that they use some dataset called crashes and are graphing some categorical variable vs some numeric variable. To make it horizontal, they are just flipping the x and y variable, easy enough.
My issue is that my categories are numeric which causes problems. A minimum reproducible example uses their dataset. Basically this should be the same graph one horizontal and the other vertical. As you can see they are both vertical...
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="whitegrid")
crashes = sns.load_dataset("car_crashes").sort_values("total", ascending=False)
crashes['roundTotal'] = np.round(crashes['total']).astype(int)
crashesMod = crashes.groupby(['roundTotal']).count().reset_index()
crashesMod['VsAverage'] = crashesMod['total'] > crashesMod.total.mean()
sns.barplot(x = 'roundTotal', y = 'total', hue = 'VsAverage', data = crashesMod)
plt.show()
sns.barplot(y = 'roundTotal', x = 'total', hue = 'VsAverage', data = crashesMod)
I tried making the column 'roundTotal' of type string as I imagined that it was doing some guessing under the hood and was failing with the 2 numeric types, but then I run into
TypeError: unsupported operand type(s) for /: 'str' and 'int'

