version:python 3.6
环境:anaconda/JupyterLab 0.27.0
操作系统:Windows 10

import pandas as pd
import matplotlib.pyplot as plt

a = pd.DataFrame(train_set['收率'].value_counts()).reset_index()
a.rename(columns={'index': 'yield','收率':'frequency'}, inplace=True)
a.head()

plt.figure(figsize=(24,8))
plt.bar(a['yield'].values,a['frequency'].values.round(2),color='rgb',width = 0.005,
tick_label=a['yield'].values.round(3))
plt.xlabel('yield', fontsize=20)
plt.ylabel('frequency', fontsize=20)
plt.show()

python柱状图参数设置

相关文章:

  • 2021-11-01
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2021-07-28
  • 2022-12-23
猜你喜欢
  • 2021-11-08
  • 2021-09-10
  • 2022-12-23
  • 2022-02-27
  • 2021-09-30
相关资源
相似解决方案