Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plots don't display when using matplotlib backend qt #320

Open
cppt opened this issue Dec 1, 2023 · 1 comment · May be fixed by #321
Open

Plots don't display when using matplotlib backend qt #320

cppt opened this issue Dec 1, 2023 · 1 comment · May be fixed by #321

Comments

@cppt
Copy link

cppt commented Dec 1, 2023

As described, the first block successfully displays inline.

When setting matplotlib backend to qt, to allow pop-out figures/interactive plottting, nothing is displayed (aside from a momentary 'Figure 1' pop up. Working in Ubuntu 22.04 using Spyder 5.3.3 and Python 3.9 with the most recent package version. What am I missing?

import quantstats as qs
%matplotlib inline

# displays successfully in Plots tab in Spyder
stock = qs.utils.download_returns('SPY')
qs.plots.returns(stock) 

# doesn't show anything
%matplotlib qt
qs.plots.returns(stock) 
@git-shogg
Copy link
Contributor

Hi @cppt , I have raised a pull request to change some of the default behaviour of the quantstats package. It might be possible that the reason why you are not seeing the graph is because you are running the script in a non-interactive mode (e.g. from the command line python filename.py) if you run this same thing from a Jupyter notebook you should receive the plot as shown below.

image

Does that help answer your question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants