Hi, for providing delay to plot points one by one, I am using kivy;s call back function. But I am somehow blocking the kivy thread. I put the code here, Can anyone tell me what i am doing wrong?
Thanks in advance!
def __init__(self, **kwargs):
super(MistakeCorrect, self).__init__(**kwargs)
self.plot = LinePlot(color=[1, 1, 0, 1], line_width = 2)
self.graph = Graph(padding = 20, xmin = 500, xmax = 800, ymin = 180, ymax = 30, draw_border = True)
self.graph.pos = 30,120
self.graph.size = 400,400
def draw(self, curr_data):
for stroke in curr_data:
for pix in stroke:
Clock.schedule_interval(partial(self.plot_points, pix, self.graph, self.plot), .5)
def plot_points(self, dt, pix, graph, plot, *largs):
self.plot.points = pix
self.graph.add_plot(self.plot)
self.add_widget(self.graph)