You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
454 B
17 lines
454 B
import matplotlib.pyplot as plt
|
|
import seaborn as sns
|
|
|
|
def plot_histogram(data, column):
|
|
fig, ax = plt.subplots()
|
|
ax.hist(data[column].dropna(), bins=20, edgecolor='k')
|
|
ax.set_title(f"Histogram of {column}")
|
|
ax.set_xlabel(column)
|
|
ax.set_ylabel("Frequency")
|
|
return fig
|
|
|
|
def plot_boxplot(data, column):
|
|
fig, ax = plt.subplots()
|
|
sns.boxplot(data=data, x=column, ax=ax)
|
|
ax.set_title(f"Boxplot of {column}")
|
|
return fig
|