Open Saltsmart opened 1 month ago
I've also wondered if this is possible, as I personally really do not like TeX or LaTeX (although I have been forced to know a lot about them haha). I think this would require more knowledge about the matplotlib backend systems and how they generate the pngs. Since graphics (circles, squares, etc.) can be abstracted irrespective of the backend (which makes them suitable candidates for object oriented programming) this could be theoretically possible.
I think at minimum it would require investigating: How hard is it to draw basic objects like circles or lines in matplotlib? Do they look as nice in matplotlib? Is the coordinate system that matplotlib uses the same as the coordinate system of TikZ?
I once thought of doing this for PDFs (i.e. cut out of TeX middle man and just go straight to PDFs) and I studied how PDFs worked. I quickly found that PDFs are extremely complex beasts, and it's hard to get a PDF to look the same across different computers. But maybe it would be easier with PNGs.
I really love the object-oriented style of tikzpy ♥. Here is a further request to extend it to matplotlib (Maybe a similar package could be developed).
Matplotlib is designed to draw plots, not diagrams, but it implements many basic shapes, such as lines, rectangles, circles... It has some pros that Tikz doesn't:
It is not an easy task, of course. I created a question in StackOverflow (it's hidden because the bot thinks this question is seeking recommendations for software libraries 😂):
However, I believe we could do the handy things first, applying the existing api in
Tikz-python
to matplotlib. If you are interested, I feel very glad to participate.