File:Multiplebesselkplot.png

From specialfunctionswiki
Revision as of 23:40, 10 June 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 x=np.arange(0.01,5,0.01); x2=np.arange(-15,15,0.1); j0=np.vectorize(lambda...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Original file(862 × 885 pixels, file size: 62 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

x=np.arange(0.01,5,0.01);
x2=np.arange(-15,15,0.1);
j0=np.vectorize(lambda x: besselk(0,x))
j1=np.vectorize(lambda x: besselk(1,x))
j2=np.vectorize(lambda x: besselk(2,x))
j3=np.vectorize(lambda x: besselk(3,x))

y0=j0(x)
y1=j1(x)
y2=j2(x)
y3=j3(x)

def h(x):
        return 0
k=np.vectorize(h)
yatzero=k(x2)

fig, ax = plt.subplots()

plt.xlabel(r'$x$')
plt.ylabel('Various Bessel functions')

plt.plot(x,y0,linewidth=2,color='Red',label=r'$K_0(x)$')
plt.plot(x,y1,linewidth=2,color='Blue',label=r'$K_1(x)$')
plt.plot(x,y2,linewidth=2,color='Green',label=r'$K_2(x)$')
plt.plot(x,y3,linewidth=2,color='Orange',label=r'$K_3(x)$')
plt.plot(yatzero,x2,'--',linewidth=2,color='Black')

plt.xlim(-0.3,5)
plt.ylim(-0.3,2)
plt.legend(loc='best')

plt.savefig('multiplebesselkplot.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/TimeThumbnailDimensionsUserComment
current23:43, 10 June 2016Thumbnail for version as of 23:43, 10 June 2016862 × 885 (62 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 x=np.arange(0.01,5,0.01); x2=np.arange(-15,15,0.1); j0=np.vectorize(lambda...
23:40, 10 June 2016Thumbnail for version as of 23:40, 10 June 2016862 × 885 (61 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 x=np.arange(0.01,5,0.01); x2=np.arange(-15,15,0.1); j0=np.vectorize(lambda...
  • You cannot overwrite this file.

The following page links to this file:

Metadata