When trying to run the following code I get this warning under it:
<ipython-input-47-f4ba06f67a93>:13: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance. ax = plt.axes()
from pylab import *
import numpy as np
from math import *
x = np.linspace(0, 10, 1000)
E = np.piecewise(x, [x < 1, ((x >= 1) & (x < 2)), x >= 2], [0 , lambda x : (1/x)-(1/x**2), lambda x : 1/(x**2)])
#Graph of |E| a epsilon / k vs. x=r/a for unitless quantities
figure()
plot(x, E)
xlabel('r / a')
ylabel('|E|a epsilon / k')
title('Behavior of |E| vs r')
ax = plt.axes()
ax.set_xticks([1, 2])
ax.set_xticklabels(['a', 'b'])
#plt.tick_params(left = False, right = False , labelleft = False ,
#labelbottom = False, bottom = False)
grid()
show()
Could anyone explain me why? and what should I do to fix it?