0

My code to put the graph onto a canvas

sns.set()
df = pd.DataFrame(stocks, columns=['Date', 'Close'])
f = plt.Figure(figsize=(6,6))
ax = f.subplots()
sns.lineplot(data=df, x='Date', y='Close', ax=ax)

canvas = FigureCanvasTkAgg(f, self)
canvas.draw()
canvas.get_tk_widget().grid(row=1, column=1)

The graph shows x and y values when you move the mouse

The graph shows x and y values when you move the mouse

When putting it on a canvas it loses the ability to show x and y values

meh

Flapjack
  • 65
  • 7

1 Answers1

0

Found a solution, and it was to add NavigationToolbar2Tk from matplotlib.backends.backend_tkagg

toolbar = NavigationToolbar2Tk(canvas, chart_frame)
toolbar.update()
Flapjack
  • 65
  • 7