I'm trying to play around with a real-time kivy graph using the kivy_garden.graph
module. However, when i run the following code, I get no error message other than a popup stating 'Python has stopped working'. Once I press cancel on that, I get Process finished with exit code -1073741819 (0xC0000005)
. Here's my code:
from math import sin
from kivy_garden.graph import Graph, MeshLinePlot
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.clock import Clock
class MyApp(App):
plot = MeshLinePlot(color=[1, 0, 0, 1])
graph = Graph(xlabel='X', ylabel='Y', x_ticks_minor=5,
x_ticks_major=25, y_ticks_major=1,
y_grid_label=False, x_grid_label=False, padding=5,
x_grid=False, y_grid=False, xmin=-0, xmax=100, ymin=-1, ymax=1,)
def build(self):
box = BoxLayout()
box.add_widget(self.graph)
Clock.schedule_interval(self.update_points, 1/60.)
Clock.schedule_interval(self.update_xaxis, 1/60.)
return box
def update_xaxis(self,*args):
self.graph.xmin = 0
self.graph.xmax = 100
def update_points(self, *args):
#self.plot.points = [(i,i)]
self.plot.points = [(x, sin(x / 10.)) for x in range(0, 101)]
MyApp().run()
My other kivy apps are running just fine on the same python installation, so I'm inclined to believe that there's something wrong with my code.
Thanks for any and all help!