pie hist plot boxplot

画大饼

import matplotlib.pyplot as plt
labels='uu','y','j','dd'
sizes=[15,30,45,10]
color=['yellow','gold','blue','red']
explode=(0,0.1,0,0)

plt.pie(size,explode=explode,labels=label,colors=colors,autopct='%1.1f%%',shadow=True,startangle=90)

plt.axis('equal')
plt.show()

pie hist plot boxplot_第1张图片

plot 画图 和scatter 类似

import numpy as np
import matplotlib.pyplot as plt

from math import sin
x=np.arange(0,10,0.2)
y=np.sin(x)
plt.plot(x,y,c='b',linewidth=1,alpha=0.7,marker='p',label='cc')

plt.title('sin()')
plt.xlabel('x')
plt.ylabel('y')
plt.legend(loc='upper right')

plt.show()

pie hist plot boxplot_第2张图片

直方图

import matplotlib.pyplot as plt
import numpy as np
x=np.random.randn(10000)
plt.hist(x,10)
plt.show()

pie hist plot boxplot_第3张图片

boxplot()

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pandas import Series


x=np.random.randn(1000)

d=pd.DataFrame([x,x+1]).T

d.boxplot()
plt.show()

pie hist plot boxplot_第4张图片

你可能感兴趣的:(pandas,python-pie,plot)