我編寫了一個使用 maplotlib 和 seaborn 的示例程序:import matplotlib as pltimport numpy as npimport randomimport seaborn as snsrolls = [random.randrange(1, 7) for i in range(600)]values, frequencies = np.unique(rolls, return_counts=True)title = f'Rolling a Six-Sided Die {len(rolls):,} Times'sns.set_style('whitegrid')axes = sns.barplot(x=values, y=frequencies, palette='bright')一切都計算正確(為簡潔起見,我省略了打?。?,但沒有顯示任何內容。我已經嘗試過在命令行下和 vscode 下。我正在運行 Windows 7、python 3.7.7 和 conda 4.8.3我錯過了什么?
1 回答

DIEA
TA貢獻1820條經驗 獲得超2個贊
你需要打印圖表,你需要下一行代碼
soportes[:].plot.bar(x='row', y='column')
#soportes[row_init: row_finish].plot.bar(x='variable', y='variable')
plt.ylabel('Soporte') #name 軸 y
plt.xlabel('Producto') #name 軸 x
plt.title('Soporte por producto Prior') #name windows
plt.savefig('Graph/Prior_Barra.png', bbox_inches="tight") #保存圖
plt.show() # 顯示圖形
刪除線軸 = sns.barplot(x=values, y=frequencies, palette='bright')
添加回答
舉報
0/150
提交
取消