date high low close Central Bottom Top_Central Resistance_1 Support_1 Central_SMA Bottom_Central_SMA Top_Central_SMA
1 2010-01-05 142.45 136.00 141.85 140.100000 139.225 140.975000 NaN NaN NaN NaN NaN
2 2010-01-06 142.70 140.40 141.00 141.366667 141.550 141.183333 143.266667 138.891667 140.733333 140.3875 141.079167
3 2010-01-07 142.65 140.05 141.60 141.433333 141.350 141.516667 142.575000 140.125000 141.400000 141.4500 141.350000
4 2010-01-08 142.40 139.85 141.90 141.383333 141.125 141.641667 142.866667 140.291667 141.408333 141.2375 141.579167
5 2010-01-11 146.00 141.95 145.35 144.433333 143.975 144.891667 144.916667 141.616667 142.908333 142.5500 143.266667
Above dataframe is pivot DataFrame in my code.
import matplotlib.dates as mdates
from matplotlib.dates import date2num
import matplotlib.pyplot as plt
Graph=pivot.copy()# Make a copy of pivot
try:
Graph.reset_index(inplace=True)
Graph['date'] = Graph['date'].apply(date2num)
except:
pass
fig= plt.figure()
ax1= fig.add_subplot(111)
ax2= fig.add_subplot(111)
ax3= fig.add_subplot(111)
ax1.xaxis_date()
ax1.xaxis.set_major_formatter(mdates.DateFormatter('%d-%m-%Y'))
ax2.plot(Graph.date, Graph['Resistance_1'], label='R1')
ax3.plot(Graph.date, Graph['Support_1'], label='S1')
plt.show()
When I run the above code I get the following error.
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:3: 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.
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:4: 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.
How to resolve this issue ?