You need to be careful how to create a dataset to build. In the code from the question, you have a list of lists of one data frame. However, you just need a list of one-column frames.
Thus, you will also need to take only the βLMPβ column from the filtered data frames, otherwise the script will not know which column will be displayed.
Here is a working example that is close to the source code:
import pandas as pd import numpy as np import matplotlib.pyplot as plt x = np.random.poisson(lam =3, size=100) y = np.random.choice(["S{}".format(i+1) for i in range(6)], size=len(x)) df = pd.DataFrame({"Scenario":y, "LMP":x}) fig, axes = plt.subplots() axes.violinplot(dataset = [df[df.Scenario == 'S1']["LMP"], df[df.Scenario == 'S2']["LMP"], df[df.Scenario == 'S3']["LMP"], df[df.Scenario == 'S4']["LMP"], df[df.Scenario == 'S5']["LMP"], df[df.Scenario == 'S6']["LMP"] ] ) axes.set_title('Day Ahead Market') axes.yaxis.grid(True) axes.set_xlabel('Scenario') axes.set_ylabel('LMP ($/MWh)') plt.show()

source share