Strange behavior #507
-
|
Hi, My suspicion is around this part of the code in the function update_plot(). Most of the code is based on the example provided in complicated.py `#!/usr/bin/env python3 import finplot as fplt stock_ohlcv_data=None def load_price_history(symbol, interval,backtest_date): def calc_plot_data(df): def update_plot(): def update_chart(): def on_key(event): if name=="main": |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
|
This was caused by an off-by-one bug, and is fixed in 203d238. |
Beta Was this translation helpful? Give feedback.
-
|
Again I ran into an issue. If i have multiple panes to display and hence multiple axes, as I press right key, one bar at a time get added. But the zoom factor changes and hence just after 4 right key presses both the charts are in a zoomed state. I am attaching the full code below. ` def compute_data(): def on_key(event): def update_plot(): def update_chart(): if name == "main": ` |
Beta Was this translation helpful? Give feedback.
-
|
The reason is they contain data which are present in one data set and not the other, which causes an uneven number of candles between the two axes. Remove the redundant data like so: pricedf = pricedf.loc[indexdf.index, :]
indexdf = indexdf.loc[pricedf.index, :] |
Beta Was this translation helpful? Give feedback.
-
|
Don't know what you're trying to do, but probably you want to disable the default key handler. def dummy(*args, **kwargs):
pass
fplt._key_pressed = dummyThen just using the most basic def update_plot():
data = compute_data()
for k in data:
if data[k] is not None:
plots[k].update_data(data[k]) |
Beta Was this translation helpful? Give feedback.
This was caused by an off-by-one bug, and is fixed in 203d238.