question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

During horizontal scrolling, sometimes daily candles disappear

See original GitHub issue

Hi,

when the resolution of the plot is at the point where the daily candles are just visible, I observe their candle bodies to disappear during horizontal scrolling.

It would be very helpful if they would be visible in all situations.

Please find below the code and the referring video.

Thanks in advance!

code

#!/usr/bin/env python3

from datetime import date, timedelta
import finplot as fplt
import pandas as pd
import scipy.optimize
import yfinance as yf

now = date.today()
start_day = now - timedelta(days=59)
df = yf.download('GOOG', start_day.isoformat(), now.isoformat(), interval='5m')

import pytz

fplt.display_timezone = pytz.timezone('UTC')

# resample to daily candles, i.e. five 90-minute candles per business day
dfd = df.Open.resample('D').first().to_frame()
dfd['Close'] = df.Close.resample('D').last()
dfd['High'] = df.High.resample('D').max()
dfd['Low'] = df.Low.resample('D').min()

ax = fplt.create_plot('Alphabet Inc.', rows=1)

# plot down-sampled daily candles first
if True:
    daily_plot = fplt.candlestick_ochl(dfd.dropna(), candle_width=5)
    daily_plot.colors.update(dict(bull_body='#bfb', bull_shadow='#ada', bear_body='#fbc', bear_shadow='#dab'))
    daily_plot.x_offset = 3.03  # resample() gets us start of day, offset +1.1 (gap+off center wick)

# plot high resolution on top
fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']])

fplt.autoviewrestore(True)

fplt.show()

video + .ini file:

simplescreenrecorder-2021-01-02_07.50.26.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
highfestivacommented, Jan 8, 2021

That is Qt not repainting things that ever went off-screen. I’ll see what I can do to circumvent.

0reactions
haimivancommented, Jan 12, 2021

Thanks a lot.

That fix seems to solve the missing candles when moving slowly!

Very good! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cells disappearing with horizontal scrolling in UICollectionView
When initializing C's UICollectionViewFlowLayout scroll direction property to .horizontal , and scrolling past the second cell, C's cells ...
Read more >
Windows Tip: How To Stop The Disappearing Scroll Bar
Go to Settings / Ease of Access / Display and turn off Automatically hide scroll bars in Windows. Scroll bars will then always...
Read more >
Copyright, cost, and ageing code: why some games disappear ...
But ageing code and connectivity issues aren't just for large-scale online service games. Released in 2015 by Dejobaan Games, Elegy For A Dead ......
Read more >
Horizontal Scrolling in Web Design: How to Do It Well
Horizontal scrolling can be achieved by clicking and dragging a horizontal scroll bar, swiping sideways on a desktop trackpad or trackpad mouse, ...
Read more >
How To End A Curse - Trailer Eksperten
At your touch, all curses affecting one creature or object end. Pray this daily or as frequently as you can. Place the candle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found