plot horizontal lines without time #284
-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
highfestiva
Dec 13, 2021
Replies: 1 comment
-
See plt
import numpy as np
import pandas as pd
dates = pd.date_range('2022-01-01', '2022-06-01', freq='1d') # future dates
prices = pd.Series(np.sin(dates.view(float)*1e199))
fplt.plot(dates, prices, width=3) # plot some price chart
# project some lines
for i in range(0, len(dates)-20, 20):
d0 = dates[i]
d1 = dates[i+20]
p0 = prices[i]
p1 = prices[i+5]
fplt.add_line((d0, p0), (d1, p1))
fplt.show() GL! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nqnga
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See
examples/line.py
for how to draw lines, orexamples/btc-long-term.py
for how to draw a bunch of vertical lines. If you want future dates in your charts, you need to set your timestamps accordingly to the time to want to predict for. Something like:GL!