Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

All images by author.

Member-only story

Custom made plots in Python with PySimpleGUI

For the DIY coder.

Keno Leon
Geek Culture
Published in
4 min readMay 27, 2021

--

First question you might have is why ? After all we have perfectly good plotting libraries like PyPlot and others…

Answer: Because sometimes you need to make something not in stock at your charting library of choice, other times you might simply want to avoid integrating libraries or have an easier time without them, and then of course you might just be curious about the do it yourself approach.

⚠️ The logic here should work on any canvas element from your GUI library ( heck, you can also port the concepts to your language of choice ), I am using PySimpleGUI because it is beginner friendly and relatively simple to use, but your mileage may vary. 

Ok, so what do we need ? At a minimum a plot or chart should have some elements like a GUI Window, canvas, a grid, ticks and the all important data…

Just like a Sandwich 🥪 add or remove layers to taste.

So making functions for each one of these elements seems a reasonable start.

Should give you:

There’s a ton of functionality missing ( compared to a plotting library ), and that is ok, you are not trying to remake a library but rather one or a few specific cases so you can move on with you life ( and project ) !

Of course you might not want a point cloud plot, so here are a couple more popular plots that should help you get started:

--

--

No responses yet