Reputation: 43
I can make many kinds of plots to tkinter canvases using matplotlib, but I'm unable to figure out how to do this using the mplfinance plot types, in which as I understand plotting is rather automated and high level such that the call 'owns' fig and ax. Has anyone had any luck getting these excellent plots to appear in tkinter guis?
Upvotes: 1
Views: 1465
Reputation: 43
Daniel Goldfarb, in the latest release of mplfinance has added functionality (returnfig = True
) to return the plot elements as objects. The call for, say, a candlestick chart for use with tkinter looks as follows:
fig, ax = mplfinance.plot(
<dataframe>,
type='candle',
style='charles',
title=<plot title>,
ylabel='Price ($)',
volume=True,
ylabel_lower='Shares\nTraded',
show_nontrading=True,
returnfig = True
)
It works beautifully.
Upvotes: 2