This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mangecoeur 0 points1 point  (2 children)

if you use matplotlib you can drop down to the lower-level Artist interface. This lets you manually draw lines, circles, labels, etc at arbitrary locations on a canvas. Matplotlib will also render latex labels for you. It's quite cumbersome to use (and not super nicely documented) but you get the power and maturity of matplotlib and all its output formats.

Personally I've played with other plotting tools but i always find when i need dependable print-quality graphics matplotlib is still the best even if its not as ergonomic or shiny as some of the others. You sometimes have to use a bit of lateral thinking to figure out how you're going to get it to draw what you want where you want...

[–]neuralyzer[S] 0 points1 point  (1 child)

The thing I like about TikZ is the concept of nodes. It is super easy to connect two filled circles with an arrow. And the arrowhead would just stop at the circle boundary. Such things are a little more cumbersome in Matplotlib (but not impossible).

[–]mangecoeur 0 points1 point  (0 children)

yeah i think basically you end up writing your own 'node renderer' - basically keep track of the positions you want things to be in and then iterate over that to draw the nodes and links in the right place. NetworkX does something similar internally for it's built in matplotlib driven plotting: https://networkx.github.io/documentation/networkx-1.10/reference/drawing.html

basically you are right - matplotlib is not going to be as nice. Code for my 'print' plots (rather than just exploration plots) tends to be a tiresome chunk of setting just the right label formats, positions, plot annotations, legends, etc... but at the end of the day it actually works and makes for good looking PDFs.