File:Chebyshevplotfrom0to50.png
From specialfunctionswiki
Revision as of 02:09, 28 November 2016 by 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...)
Size of this preview: 588 × 600 pixels. Other resolutions: 235 × 240 pixels | 868 × 885 pixels.
Original file (868 × 885 pixels, file size: 17 KB, MIME type: image/png)
#!/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() #xlabels = [item.get_text() for item in ax.get_xticklabels()] #xlabels=[r'$-4$',r'$-3$',r'$-2$',r'$-1$',r'$0$',r'$1$',r'$2$',r'$3$',r'$4$'] #ax.set_xticks([-4,-3,-2,-1,0,1,2,3,4]) #ax.set_xticklabels(xlabels,horizontalalignment='center') plt.xlabel(r'$x$') plt.ylabel(r'$\vartheta(x)$') #plt.ylim(0,200) #plt.xlim(0,20) 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: