Using this code to plot the iris dataset gives me an extra empty plot:
import pandas as pd
from matplotlib import pyplot as plt
d = {'Species': ['setosa', 'versicolor','virginica'], 'Sepal length': [1, 2, 3], 'Sepal width': [2, 4, 6]}
df = pd.DataFrame(data=d)
unv = df['Species'].unique()
colorv = ['r','b','g']
markerv = ['v', 'o', '>']
#Getting an extra empty plot for no reason
fig, ax=plt.subplots(1,2)
for i in range(len(unv)):
df[df['Species'] == unv[i]].plot(x="Sepal length", y="Sepal width", kind="scatter",ax=ax[0],label=unv[i],color=colorv[i], marker = markerv[i])
plt.show()
Any suggestions why I receive this extra plot and how I can remove it?

fig, ax=plt.subplots(1,2)is creating 2 axes (plots). Ifunvhas only one element, then you get only one iteration and one plot. Try to printlen(unv). If this is not it, check if one of the elements is not empty. A way to avoid the first issue is to do:fig, ax = plt.subplots(1, len(unv)).unv, as I could have guess with the use of 3 colors and markers. Thus why are you creating only 2 axes? Did you check the data you are trying to plot (iris[iris['Species'] == unv[i]])?