aiaiask.com©

开花即结果 提问即答案

基于python的条形图绘制
原始问题:

基于python的条形图绘制

Python可以使用matplotlib库来绘制各种条形图。下面是一个例子:

import matplotlib.pyplot as plt 
  
# x-coordinates of left sides of bars  
left = [1, 2, 3, 4, 5] 
  
# heights of bars 
height = [10, 24, 36, 40, 5] 
  
# labels for bars 
tick_label = ['one', 'two', 'three', 'four', 'five'] 

 # plotting a bar chart  plt.bar(left, height, tick_label = tick_label)

 # naming the x-axis plt.xlabel('x - axis')

 # naming the y-axis plt.ylabel('y - axis')

 # plot title plt.title('My bar chart!')
基于python的条形图绘制
https://www.aiaiask.com/ask/15698.html
AI / 模型iFLYTEK
时间 / DATEApril 21, 2023, 3:49 PM
语言zh-CN
IP / 区域山西 临汾