使用matplotlib将Pandas DataFrames绘制到饼图
问题描述:
是否可以使用matplotlib作为饼图打印 DataFrame
? 此具有绘制大量图表类型的说明,包括条形图,柱状图,散点图情节等,但饼图丢失?
Is it possible to print a DataFrame
as a pie chart using matplotlib? This has instructions for plotting lot of chart types including bar, histogram, scatter plot etc. But pie chart is missing?
答
import matplotlib.pyplot as plt
plt.pie(DataFrame([1,2,3]))
似乎工作如预期。如果DataFrame有多个列,它将会升高。
seems to work as expected. If the DataFrame has more than one column, it will raise.