Python Kivy:如何在Kivy garden graph中将x轴刻度从数字更改为日期或时间值?
我想将Python Kivy:如何在Kivy garden graph中将x轴刻度从数字更改为日期或时间值?,python,graph,kivy,python-3.8,Python,Graph,Kivy,Python 3.8,我想将kivy garden Graph的x轴从数字更改为日期值 我想要这样的东西: 这是我的密码: 有解决办法吗?提前谢谢你 from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy_garden.graph import Graph, LinePlot import math class MyGrid(GridLayout): def __init__(self, **kwargs
kivy garden Graph
的x轴从数字更改为日期值
我想要这样的东西:
这是我的密码:
有解决办法吗?提前谢谢你
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy_garden.graph import Graph, LinePlot
import math
class MyGrid(GridLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cols = 1
self.plot = LinePlot(line_width=1.5, color=[1, 0, 0, 1])
self.graph = Graph(xlabel='Date', ylabel='Y', x_ticks_minor=5,
x_ticks_major=25, y_ticks_major=1,
y_grid_label=True, x_grid_label=True, padding=5,
x_grid=True, y_grid=True, xmin=0, xmax=200, ymin=-2, ymax=2,
x_ticks_angle=90)
self.plot.points = [(x, math.sin(x / 10.)) for x in range(0, 201)]
self.graph.add_plot(self.plot)
self.add_widget(self.graph)
class MyKivy(App):
def build(self):
return MyGrid()
if __name__ == "__main__":
MyKivy().run()