I've been looking it up all over the Internet to find the solution to this issue(like spending 2 days...it's killing me).
As it turns out, I just need to set a background_color for the graph. THAT'S IT. Now here is what I expect the result to be after I click "Receive Data" button (simulating the process that receives data from sensors).
so all u need to do is set the background_color of the graph, by graph themes.
Now here is my pseudocode,
graph_theme = {'background_color'::'f8f8f2')}
graph = Graph(...,xmax=100, **graph_theme)
plot = MeshLinePlot(color=[1, 0, 0, 1])
append points to plot when u receive more data:plot.points.append((x,y))
when u want scale the graph in x-axis,say 200: graph.xmax = 200
This will draw a real time graph.
And could anyone explain to me why the background_color attribute affects my issue here?