使用matplotlib将Pandas DataFrames绘制到饼图 [英] Plotting Pandas DataFrames in to Pie Charts using matplotlib

查看:2379
本文介绍了使用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.

这篇关于使用matplotlib将Pandas DataFrames绘制到饼图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆