from matplotlib import pyplot as plt
seed = 0
import numpy as np
import seaborn as sns
labels_comp = np.random.randint(0,4,[50])
print(labels_comp)
fig, ax = plt.subplots(1, 1, figsize=(18, 8))
# ax = sns.countplot(y=labels_comp, palette='viridis')
ax = sns.countplot(x=labels_comp, palette='viridis') #横向
ax = sns.countplot(y=labels_comp, palette='viridis') #竖向
# sns.barplot(y,x)
ax.tick_params(labelsize=16)
plt.show()
可视化画柱状图
最新推荐文章于 2024-04-19 21:04:10 发布