I am trying to set up 4 plots on a window that update every second with value from 4 different analog inputs (dynamic plot). How would I set the axis (and possibly label them as 0% to 100%) so they don't update. I would also like the window to run fullscreen but the techniques I have tried just give me errors, if anyone could point me to a good tutorial that would be great! Here is my code so far
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure()
ax1 = fig.add_subplot(1,2,1)
ax2 = fig.add_subplot(1,2,2)
#Function to read analog inputs
def readadc(.....)
def animate(i):
colorVar = 'g'
graph_data = readadc(...)
if (graph_data , 300):
colorVar = 'r'
else:
colorVar = 'g'
ax1.clear()
ax2.clear()
ax1.axes.get_xaxis().set_ticks([])
ax2.axes.get_xaxis().set_ticks([])
ax1.bar(0,graph_data, color=colorVar)
ax2.bar(0,graph_data, color=colorVar)
ani = animation.FuncAnimation(fig, animate, interval=1000)
mng = plt.get_current_fig_manager()
mng.ax1.Maximize(True)
plt.show()