Difference between revisions of "File:Chebyshevplotfrom0to50.png"
From specialfunctionswiki
(Category:Plot <pre>#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from mpmath import * from pylab import rcParams rcParams['figure.figsize'] = 10, 10 def isValid(n): if (n <=0): return 0 elif...) |
|||
Line 31: | Line 31: | ||
fig, ax = plt.subplots() | fig, ax = plt.subplots() | ||
− | |||
− | |||
− | |||
− | |||
− | |||
plt.xlabel(r'$x$') | plt.xlabel(r'$x$') | ||
plt.ylabel(r'$\vartheta(x)$') | plt.ylabel(r'$\vartheta(x)$') | ||
− | |||
− | |||
− | |||
plt.plot(x,y,linewidth=2,color='Black') | plt.plot(x,y,linewidth=2,color='Black') | ||
plt.savefig('chebyshevplot.png',bbox_inches='tight',pad_inches=0.15)</pre> | plt.savefig('chebyshevplot.png',bbox_inches='tight',pad_inches=0.15)</pre> |
Latest revision as of 02:12, 28 November 2016
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from mpmath import * from pylab import rcParams rcParams['figure.figsize'] = 10, 10 def isValid(n): if (n <=0): return 0 elif (n-int(n) != 0): return 0 return 1 def isPrime(n): return not (n < 2 or any(n % i == 0 for i in range(2, int(n**0.5)+1))) def Chebyshev(n): if not isValid(n): return 0 chebyshev = 0 for p in range(1,n): if (isPrime(p)): chebyshev += log(p) return chebyshev x=np.arange(0,50,0.01); f=np.vectorize(lambda x: Chebyshev(floor(x))) y=f(x) fig, ax = plt.subplots() plt.xlabel(r'$x$') plt.ylabel(r'$\vartheta(x)$') plt.plot(x,y,linewidth=2,color='Black') plt.savefig('chebyshevplot.png',bbox_inches='tight',pad_inches=0.15)
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 02:09, 28 November 2016 | 868 × 885 (17 KB) | Tom (talk | contribs) | Category:Plot <pre>#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from mpmath import * from pylab import rcParams rcParams['figure.figsize'] = 10, 10 def isValid(n): if (n <=0): return 0 elif... |
- You cannot overwrite this file.
File usage
The following page links to this file: