import seaborn as snsimport matplotlib.pyplot as pltimport pandas as pd# Sample datadata = {'Category': ['A', 'B', 'C', 'D'],'Values': [23, 45, 56, 78]}df = pd.DataFrame(data)# Create a barplotsns.set(style="whitegrid") # Optional: Set a clean grid styleplt.figure(figsize=(8, 6)) # Set the figure sizesns.barplot(data=df, x='Category', y='Values', palette='viridis')# Customize the plotplt.title("Bar Plot Example", fontsize=16)plt.xlabel("Category", fontsize=12)plt.ylabel("Values", fontsize=12)# Show the plotplt.show()
FutureWarning:
Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `x` variable to `hue` and set `legend=False` for the same effect.
sns.barplot(data=df, x='Category', y='Values', palette='viridis')