python图形绘制源代码.docVIP

  • 14
  • 0
  • 约2.27万字
  • 约 28页
  • 2021-08-13 发布于广东
  • 举报
. . 精品 精品 . 精品 饼图 import matplotlib.pyplot as plt # Pie chart, where the slices will be ordered and plotted counter-clockwise: labels = Frogs, Hogs, Dogs, Logs sizes = [15, 30, 45, 10] explode = (0, 0.1, 0, 0) # only explode the 2nd slice (i.e. Hogs) fig1, ax1 = plt.subplots() ax1.pie(sizes, explode=explode, labels=labels, autopct=%1.1f%%, shadow=True, startangle=90) ax1.axis(equal) # Equal aspect ratio ensures that pie is drawn as a circle. plt.show() 条形图1 import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator from collections import namedtuple

文档评论(0)

1亿VIP精品文档

相关文档