python tkinter plot points

Solutions on MaxInterview for python tkinter plot points by the best coders in the world

showing results for - "python tkinter plot points"
Cyril
22 Sep 2019
1from tkinter import *
2from tkinter.ttk import *
3
4import matplotlib
5matplotlib.use("TkAgg")
6
7from matplotlib.figure import Figure
8from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
9
10root = Tk()
11
12figure = Figure(figsize=(5, 4), dpi=100)
13plot = figure.add_subplot(1, 1, 1)
14
15plot.plot(0.5, 0.3, color="#C41E3A", marker="o", linestyle="") # Plotting points
16
17x = [ 0.1, 0.2, 0.3 ]
18y = [ -0.1, -0.2, -0.3 ]
19plot.plot(x, y, color="blue", marker="x", linestyle="")	# Plotting points
20
21canvas = FigureCanvasTkAgg(figure, root)
22canvas.get_tk_widget().grid(row=0, column=0)
23
24root.mainloop()	# Running application