0

I am using this simplified code to create mutiple boxplots:

from sklearn.datasets import load_iris
import pandas as pd
import matplotlib.pyplot as plt

data = load_iris()
df = pd.DataFrame(data.data, columns=data.feature_names)

df["index"]=range(1,len(df)+1)
df["CustomColumn"]=0

header=list(df.columns)
fig, axs = plt.subplots(1, 5, figsize=(10,  5), sharey=False)
boxplot=df.boxplot(by=CustomColumn, layout=(1,5), ax=axs)
plt.savefig("DataframeBoxplot.png")
plt.show()

For some other reason I need to group the boxplots by a CustomColumn. Are there any possibilities to remove the [CustomColumns] under the plots as shown in the figure below?

BoxPlots

funie200
  • 3,688
  • 5
  • 21
  • 34
NobaPy
  • 1
  • 1
  • 1
    Does this answer your question? [Hiding axis text in matplotlib plots](https://stackoverflow.com/questions/2176424/hiding-axis-text-in-matplotlib-plots) – GRquanti Jan 23 '20 at 19:58
  • Yes, thank you. I am sorry for missing this. I had to iterate over the axes: for axis in axs: axis.axes.get_xaxis().set_visible(False) – NobaPy Jan 23 '20 at 21:00

0 Answers0