def draw(self, *args):
    self.canvas.clear()
    if hasattr(self, 'parent'):
        self.ratio = min(self.parent.size_hint_x, self.parent.size_hint_y)
    self.dim = min(self.width, self.height)
    self.update_ticks(*args)
    self.update_plots(*args)
def draw(self, *args):
    self.canvas.clear()
    if hasattr(self, 'parent'):
        self.ratio = min(self.parent.size_hint_x, self.parent.size_hint_y)
    self.dim = min(self.width, self.height)
    self.update_ticks(*args)
    self.update_plots(*args)