def tick(min, max, axis=None):
"""
trying to mimic a stock market ticker
"""
if axis == "X":
return datetime.datetime.now().strftime("%H:%M:%S")
else:
min = int(min)
max = 100
return randint(min, max)
def main():
X = []
Y = []
fig = plt.Figure()
fig.plot(X, Y)
fig.set_x_limits(min_=0)
fig.set_y_limits(min_=0, max_=100)
while True:
fig.x_ticks_fkt = partial(tick, axis="X")
fig.y_ticks_fkt = partial(tick)
__import__('time').sleep(1)
print(fig.show())
if __name__ == '__main__':
main()
outputs
honestly i was surprised by the end result. i just a have an incoming ticker which has a changing price and datetime.seconds. i want just to append it to the x axis and show the new y value (price of the stock). can you please help me.
outputs![plotille](https://github.com/tammoippen/plotille/assets/12350276/d9c6a9e2-cecc-49f2-88cb-f1bcb5ecefe3)
honestly i was surprised by the end result. i just a have an incoming ticker which has a changing price and datetime.seconds. i want just to append it to the x axis and show the new y value (price of the stock). can you please help me.