#Ziaplot

Alexandre B A Villaresvillares@pynews.com.br
2024-08-25

Quick #py5 + #Ziaplot experiment :)

I could have used the PNG output provided by Ziaplot, but I wish py5's convert_image (also using cairosvg under the hood) could handle in memory SVG-bytes (or maybe it does and I haven't figured it out) cc @codeismycanvas @py5coding

Alexandre B A Villaresvillares@pynews.com.br
2024-08-25

#Ziaplot & #PyQt5, SVG on a #Python GUI, example from the docs ziaplot.readthedocs.io/en/late (there is anotehr exemple that renders the graph as PNG for embeding on #TkInter)

Code from https://ziaplot.readthedocs.io/en/latest/gui.html on Thonny IDE and an overlapping window with a nice linear graph of randomly growing values.
Alexandre B A Villaresvillares@pynews.com.br
2024-08-25

A new version of #Ziaplot (ziaplot.readthedocs.io) is out, thanks to @codeismycanvas "[Ziaplot is a] #Python package for drawing geometric #diagrams, #charts, and discrete data #plots. While the well-known plotting libraries focus on plotting discrete data points, ziaplot treats geometric diagrams...as first-class citizens...."

Why another plotting library?

Anyone who has been around Python long enough should be familiar with Matplotlib, the de facto standard for data visualization with Python. Matplotlib is powerful and flexible - it can plot anything. However, it was designed for plotting empirical data in the form of arrays of x and y values, so graphing true mathematical functions or geometric figures (lines, circles, segments, curves, etc.) typically becomes a chore of discretizing the function or shape into an array first.

Additionally, Matplotlib has a confusing, non-Pythonic programming interface. What’s the difference between a figure() and Figure()? Why does documentation sometimes use plt.., sometimes ax.., and sometimes the awful from pylab import *? It is also a huge dependency, requiring Numpy libraries and usually bundling several UI backends along with it. A simple Tkinter UI experiment (see Embedding in a GUI), built into an executable with Pyinstaller, was 25 MB when the data was plotted with Ziaplot, but over 500 MB using Matplotlib! There are some Matplotlib alternatives. Seaborn just wraps Matplotlib to improve its interface. Plotly and Bokeh focus on interactivity and web applications.

Ziaplot was created as a light-weight, easy to use, fast, and Pythonic library for making static diagrams and graphs in SVG format, while treating mathematical functions and geometric figures as first-class citizens.
2024-08-24

I just released a new version of ziaplot, my Python package for drawing geometric diagrams, charts, and discrete data plots. While the well-known plotting libraries focus on plotting discrete data points, ziaplot treats geometric diagrams, such as this unit circle illustration, as first-class citizens. No trig calculations or discretization required from the user.

Docs: ziaplot.readthedocs.io/
Source: github.com/cdelker/ziaplot

#ziaplot #python #plotting #datavis #geometry #graph #chart #diagram

Screenshot of ziaplot code. The code draws a diagram illustrating sine and cosine functions on a unit circle. The code is run in a Jupyter Notebook cell.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst