I am trying to create a box plot from a data set and then change background color for each of the subplots:
url = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/iris.csv"
column_names = ['sepal-length', 'sepal-width', 'petal-length', 'petal-width', 'class']
data_set = read_csv(url, names=column_names)
data_set.plot(kind="box", subplots=True, color="yellow", layout=(2, 2), sharex=False, sharey=False)
pyplot.subplot(221).set_facecolor("red")
pyplot.subplot(222).set_facecolor("purple")
pyplot.subplot(223).set_facecolor("green")
pyplot.subplot(224).set_facecolor("blue")
pyplot.show()
I do get the colored subplots, however, I keep getting the warning message:
MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
Does anyone know how to fix this issue?