I'm plotting a graph using the database values for temperature, pressure and humidity. The y axis values are all messed up. Hod do I fix it?
def plot_graph():
time_arr = [date.date for date in qry.all()]
temp_arr = [temp.temp for temp in qry.all()]
humid_arr = [humid.humidity for humid in qry.all()]
pressure_arr = [press.pressure for press in qry.all()]
p1 = plt.subplot2grid((3, 3), (0, 0), colspan=2)
p2 = plt.subplot2grid((3, 3), (0, 2), rowspan=3, colspan=2)
p3 = plt.subplot2grid((3, 3), (1, 0), rowspan=2)
p1.bar(time_arr, temp_arr, color = 'r', label = 'Temperature', width=1)
p2.bar(time_arr, humid_arr, color = 'b', label = 'Humidity', width=0.5)
p3.plot(time_arr, pressure_arr, color = 'g', label = 'Pressure')
p1.set_ylim(min(temp_arr), max(temp_arr))
plt.tight_layout()
plt.legend()
plt.show()