'''Graph of x*sin(1/x)'''

import numpy as np
import matplotlib.pyplot as plt

x1 = np.arange(0,0.183,1e-6)   # 1e-6 is a shortcut for 0.000001
x1 = x1[1:]   # Removes the first element of the array to avoid division by 0.
y1 = x1*np.sin(1./x1);

x2 = np.arange(-0.183,0,1e-6)
y2 = x2*np.sin(1./x2);

plt.figure()
plt.plot(x1,y1,'k',x2,y2,'k',[-0.2, 0.2],[0, 0],'k',[0, 0],[-0.15, 0.15],'k',
         0.201,0,'k>',0,0.151,'k^')
plt.axis([-0.21, 0.21, -0.16, 0.16])

plt.show()