-
Notifications
You must be signed in to change notification settings - Fork 653
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
How to embed mplfnance in the application of pyqt5? #355
Comments
@lyl1836
Then read this about mplfinance: hth. all the best. --Daniel |
@DanielGoldfarb if self.canvas:
self.hLayoutMap.removeWidget(self.convas)
sip.delete(self.canvas)
plt.cla
plt.clf()
plt.close(self.canvas)
fig, axlist = mpf.plot(self.df, returnfig=True)
canvas = FigureCanvasQTAgg(fig)
self.hLayoutMap.addWidget(canvas) |
@DanielGoldfarb : |
@lyl1836
Can you tell me how you solved the problem, in case someone reports a similar problem? |
Hello, |
@stevedidienne if self.canvas:
self.hLayoutMap.removeWidget(self.convas)
sip.delete(self.canvas)
plt.cla
plt.clf()
plt.close(self.canvas)
aps = [ mpf.make_addplot(somedata,kwargs,...),
mpf.make_addplot(otherdata,kwargs,...), ]
fig, axlist = mpf.plot(self.df,returnfig=True,addplot=aps,volume=True)
canvas = FigureCanvasQTAgg(fig)
self.hLayoutMap.addWidget(canvas) Alternatively, if you want to set you own Axes, then use If for any reason, the above answer is not clear to you, then I recommend that you first read completely the following documentation: ... then try again what you want to do (and then, if still having issues, post a follow up question here). Please note: External Axes mode is discouraged. Although it gives you greater control over the Figure and Axes objects, there are some mplfinance features that are not available (because mplfinance no longer has control over the creation of the Figure and Axes objects). This technique should only be used if you are quite familiar with Matplotlib, and if what you are trying to accomplish cannot be done in any other way (ask, maybe it can!) |
Hi,Daniel:
Mplfinance is very convenient! Thank you !
I want to build a financial analysis tool with pyqt5. I want to embed mplfinance generated charts in pyqt5. What should I do?
Thank you very much.
The text was updated successfully, but these errors were encountered: