I'm trying to create a 4x4 FacetGrid in seaborn for 4 boxplots, each of which is split into 3 boxplots based on the iris species in the iris dataset. Currently, my code looks like this:
sns.set(style="whitegrid")
iris_vis = sns.load_dataset("iris")
fig, axes = plt.subplots(2, 2)
ax = sns.boxplot(x="Species", y="SepalLengthCm", data=iris, orient='v',
ax=axes[0])
ax = sns.boxplot(x="Species", y="SepalWidthCm", data=iris, orient='v',
ax=axes[1])
ax = sns.boxplot(x="Species", y="PetalLengthCm", data=iris, orient='v',
ax=axes[2])
ax = sns.boxplot(x="Species", y="PetalWidthCm", data=iris, orient='v',
ax=axes[3])
However, I'm getting this error from my interpreter:
AttributeError: 'numpy.ndarray' object has no attribute 'boxplot'
I'm confused on where the attribute error is exactly in here. What do I need to change?