have plotted a graph which has time on x axis and delta time on y axis. when the graph is saved as html using mpld3 maximum value on y axis is changed. how to have save graph as html without changing the value on y axis.
import matplotlib.pyplot as plt,mpld3
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import pandas as pd
import datetime
from datetime import datetime
css = """
text.mpld3-text, div.mpld3-tooltip {
font-family: 'Lato', sans-serif; font-weight: 80;
font-size: 10px;
border: 5px;
}
"""
with open('k.html', 'w') as f:
date = ['3 Jan 2013', '4 Jan 2013', '5 Jan 2013', '6 Jan 2013', '7 Jan 2013',
'8 Jan 2013', '9 Jan 2013', '10 Jan 2013', '11 Jan 2013', '12 Jan 2013',
'13 Jan 2013', '14 Jan 2013']
time = ['0:0:04', '00:00:20', '0:0:40', '00:00:55', '00:48:00', '00:49:00',
'00:00:7', '00:00:50', '00:00:10', '00:00:30', '00:1:01', '00:01:04']
time2=[]
for i in range(0,len(time)):
time2.append(datetime.strptime(time[i], '%H:%M:%S'))
ax=plt.gca()
# Convert to matplotlib's internal date format.
line1 = ax.plot(pd.to_datetime(date),time2, linewidth=1, marker=".", markerfacecolor="none", markeredgecolor="g")
plt.show()
plt.title("x")
plt.ylabel('Delta Time (SBX)')
mpld3.save_html(plt.gcf(), f, template_type='simple',figid='fig01')
#plt.show()
mpld3.save_html(plt.gcf(), f, template_type='simple',figid='fig01')
f.write('\n\n\n<script type="text/javascript">\n')
f.write('var f1=')
mpld3.save_json(plt.gcf(), f)
f.write(';\n\n')