Difference between revisions of "File:Struveplots.png"

From specialfunctionswiki
Jump to: navigation, search
(<pre>#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from mpmath import * from pylab import rcParams import scipy.special rcParams['figure.figsize'] = 10, 10 x=np.arange(-16,16,0.001); f=np.vectorize(lambda x: scipy.special.struve...)
(No difference)

Revision as of 00:14, 22 October 2017

#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
from mpmath import *
from pylab import rcParams
import scipy.special
rcParams['figure.figsize'] = 10, 10

x=np.arange(-16,16,0.001);
f=np.vectorize(lambda x: scipy.special.struve(0,x))
y=f(x)
f2=np.vectorize(lambda x: scipy.special.struve(1,x))
f3=np.vectorize(lambda x: scipy.special.struve(2,x))
f4=np.vectorize(lambda x: scipy.special.struve(3,x))
f5=np.vectorize(lambda x: scipy.special.struve(0.5,x))
y2=f2(x)
y3=f3(x)
y4=f4(x)
y5=f5(x)

fig, ax = plt.subplots()

plt.xlabel(r'$x$')
plt.ylabel(r'Struve functions')

plt.xlim(-15,15)

plt.plot(x,y,linewidth=2,color='Black',label=r'$\mathbf{H}_0(x)$')
plt.plot(x,y5,linewidth=2,color='Orange',label=r'$\mathbf{H}_{1/2}(x)$')
plt.plot(x,y2,linewidth=2,color='Red',label=r'$\mathbf{H}_1(x)$')
plt.plot(x,y3,linewidth=2,color='Blue',label=r'$\mathbf{H}_2(x)$')
plt.plot(x,y4,linewidth=2,color='Green',label=r'$\mathbf{H}_3(x)$')

plt.legend(loc='best')

plt.savefig('struveplots.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
current00:14, 22 October 2017Thumbnail for version as of 00:14, 22 October 2017863 × 846 (64 KB)Tom (talk | contribs)<pre>#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from mpmath import * from pylab import rcParams import scipy.special rcParams['figure.figsize'] = 10, 10 x=np.arange(-16,16,0.001); f=np.vectorize(lambda x: scipy.special.struve...
  • You cannot overwrite this file.

The following page links to this file:

Metadata