Skip to Content
Tkinter GUI Application Development Blueprints, Second Edition - Second Edition
book

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

by Bhaskar Chaudhary
March 2018
Beginner to intermediate
422 pages
10h 33m
English
Packt Publishing
Content preview from Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Graphing with Tkinter

Tkinter is not a graphing tool. However, should you need to draw graphs with Tkinter, you can use the Canvas widget to draw graphs.

In this iteration, we will draw the following graphs:

  • Pie chart (8.02_pie_chart.py)
  • Bar graph (8.03_bar_graph.py)
  • Scatter plot (8.04_scatter_plot.py)

The three graphs show up as follows:

Let's look at the pie chart first. You can easily create a pie chart in Tkinter using the Canvas widget's create_arc method.

The create_arc method has the following signature:

item_id = canvas.create_arc(x1, y1, x2, y2, option, ...)

Point (x1, y1) is the top-left corner and point (x2, y2) is the bottom-right ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tkinter GUI Application Development Blueprints

Tkinter GUI Application Development Blueprints

Bhaskar Chaudhary

Publisher Resources

ISBN: 9781788837460Supplemental Content