this post was submitted on 29 Jun 2023
19 points (100.0% liked)
Programming
17366 readers
495 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I went with
ggplot2
some time ago, despite not using or knowing R at all. What pushed me in that direction was that I was using other plotting libraries (I don't recall which at the time), and there was some aspect of spacing between elements or some such that was making a particular plot look ever so slightly ugly in my eyes... and I couldn't fix it!In my frustration, I consciously decided to set aside my version of your "reasonably designed" requirement (I find R consistently frustrating in this regard, though I know some people do all their programming in it and I salute them). I gave
ggplot2
a try with a cargo culting approach: search for how to make the kind of plot you want to make, and just tweak that template. I was blown away. I could find recipes for everything I wanted to do, the results were instantly more attractive than what I had before, and I could tweak everything.matplotlib
is absolutely a reasonable option, but even years later I still have R environments attached to most projects specifically for data visualization, and still produce plots that are delightfully aesthetic. So here's one voice to say thatggplot2
has real merit, especially if your aim is specifically to produce visualizations rather than explore a programming ecosystem.Just about everything is modifiable in matplotlib... It may not be easy, but all plotting libraries are designed to make some things easy at the expense of making other tasks more difficult. For matplotlib you just have to think about things the way matlab thinks about things... which is more computer graphics based. It can get ugly until you understand it. But if you understand how any plotting library actually works it's not that bad. All plotting libraries ultimately are built on graphical primitives like lines and fonts and triangles and patches computing where things belong by transforming coordinates and feeding them to a layout engine. It's not as magical as the APIs make them seem. So if you're willing to dig into their bowels (as OP mentions) there really aren't any many limits. Sometimes it's actually easiest to just declare a canvas in memory and draw it all by hand. Ultimately, things are either vector or raster formats (or some abstraction that supports both) and fed into some computer graphics engine (like postscript or some OS's or GPU canvas).
Anyway, sometimes the easiest answer is you export and edit the labels in the final figure. One really nasty way if you don't have PS or PDF tools is to sidetrack through Windows EMF and mess with fonts and positioning of text in PowerPoint.