plot=df.plot.pie(title="Colors",y='MATH',autopct='%1.1f%%')
fig = plot.get_figure()
fig.savefig("D:\\my_data\\output2.png")
With subplots=True
plot=df.plot.line(subplots=True)[0].get_figure()
plot.savefig('my_pic.jpg')
Plotting graphs using DataFrame
| plot-line | Plotting line graph with different options |
| plot-bar | Plotting bar graph with different options |
| plot-barh | Plotting Horizontal bar graph with different options |
| plot-hist | Histogram with different options |
| plot-boxplot | boxplot with different options |
| plot-pie | Pie diagram with different options |
| plot-density | Density diagram with different options |
| plot-area | Area diagram with different options |
| plot-scatter | Scatter plot with different options |
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.