Python draw a picture (LOL)

CSDN Zhang sharp pictures (on the forum Slam ), fully reflects the majority of science-loving boy of perhaps see these circumstances, we can not give programmers a disgrace, so we come out a draw.

piperzero 's blog gives a python program, but no picture, I rewrote down, the picture pasted.

 

The modified source code as follows:

# -*- coding: utf-8 -*-
#!/usr/bin/python  
from pylab import *
x = linspace(0, 1, 5000)
fig, ax = plt.subplots()
for n in range(2,6,1):
    y=abs(n/4*x*log(x)-1.0/36*exp(-(36.0*x-36.0/exp(1))**4))
    ax.plot(y, x, label=r'$n=%d$' %n)
ax.legend();
fig


plt.title(u'LOL')  #标签
plt.xlabel(u'x')
plt.ylabel(u'y')
text(0.1,0.9,r'$f(x)=\frac{n}{4}{log}(x)-\frac{1}{36}e^{-(36x-\frac{36}{e})^4}$',fontsize=18)
plt.grid(True) #网格显示 
plt.xlim(0,1)
#plt.axis([-0.05,1.2,-1.5,0.2])   #坐标轴范围
plt.show()

Published 34 original articles · won praise 9 · views 90000 +

Guess you like

Origin blog.csdn.net/tianyatest/article/details/51669577