File:Logarithmplot.png

From specialfunctionswiki
Jump to: navigation, search
Original file(861 × 891 pixels, file size: 28 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,10,0.01);
x2=np.arange(-10,10,1);
f=np.vectorize(log)
y=f(x)
def g(x):
        return 0
h=np.vectorize(g)
y2=h(x2)

fig, ax = plt.subplots()

xlabels = [item.get_text() for item in ax.get_xticklabels()]
xlabels=[r'$0$',r'$\frac{1}{e}$',r'$1$',r'$2$',r'$e$',r'$3$',r'$4$',r'$5$',r'$6$',r'$7$',r'$8$',r'$9$',r'$10$']
ax.set_xticks([0,0.3678794,1,2,2.71828,3,4,5,6,7,8,9,10])
ax.set_xticklabels(xlabels,horizontalalignment='center')

plt.xlabel(r'$x$')
plt.ylabel(r'$\log(x)$')

plt.xlim([-0.3,10.3])
plt.ylim([-5,3])

plt.plot(x,y,linewidth=2,color='Black')
plt.plot(y2,x2,'--',linewidth=2,color='Black')

plt.savefig('logarithmplot.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
current05:34, 4 June 2016Thumbnail for version as of 05:34, 4 June 2016861 × 891 (28 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,10,0.01); x2=np.arange(-10,10,1); f=np.vectorize(log) y=f(...
  • You cannot overwrite this file.

The following page links to this file:

Metadata