matplotlib画图(4)

import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0.0, 2.0, 0.01)
s = np.sin(2*np.pi*t)
plt.plot(t,s)
plt.title(r'$\alpha_i > \beta_i$', fontsize=20)
plt.text(1, -0.6, r'$\sum_{i=0}^\infty x_i$', fontsize=20)
plt.text(0.6, 0.6, r'$\mathcal{A}\mathrm{sin}(2 \omega t)$',
fontsize=20)
plt.xlabel('time (s)')
plt.ylabel('volts (mV)')


matplotlib画图(4)_第1张图片

 

 

import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, polar=True)
r = np.arange(0,1,0.001)
theta = 2*2*np.pi*r
line, = ax.plot(theta, r, color='#ee8d18', lw=3)
ind = 800
thisr, thistheta = r[ind], theta[ind]
ax.plot([thistheta], [thisr], 'o')
ax.annotate('a polar annotation',
	xy=(thistheta, thisr), # theta, radius
	xytext=(0.05, 0.05), # fraction, fraction
	textcoords='figure fraction',
	arrowprops=dict(facecolor='black', shrink=0.05),
	horizontalalignment='left',
	verticalalignment='bottom',
)
plt.show()


matplotlib画图(4)_第2张图片

 

 

你可能感兴趣的:(matplotlib画图(4))