Hacker News new | ask | show | jobs
by kpgiskpg 2205 days ago
I've always hated matplotlib, even though it gets the job done. The graphs are ugly by default, and the API would be unusable if it weren't for StackOverflow. Maybe I just need to sit down and learn it really well.

Anyway, this seems cool.

3 comments

> even though it gets the job done

How is this an addendum, rather than the main point? I will always take a flexible library that allows me to "get the job done" over a declarative framework that will do something similar to—but not exactly—what I need.

Getting the job done is the main point, of course, but I think a visualisation library should also handle common cases gracefully and have defaults that don't make me want to gouge my eyes out.

Every time I use matplotlib, I have to look up how to remove the border on my graph, make things slightly transparent, etc. The default colour palette isn't colourblind friendly, so the other day I spent half an hour trying to set up a more accessible one. I had to create / fetch 3 objects, their names being something like ScalarMap, Normalize and cmap. Why do I need to understand the relationship between these 3 objects when all I want to do is switch from one palette to another?

Meanwhile, it's so flexible as to be annoying for a non-expert. I often encounter matplotlib answers on StackOverflow about things that I would expect to "just work", but that actually require 20 lines of code to solve, written by someone who appears to be deeply familiar with the internals of the library.

Note: I'm not saying that a declarative approach solves these things.

I've come to the same conclusion.

GGplot2 is _very_ nice to use and an incredible library...as long as you want to do something the package author approves of. Want to change some behavior about how bins are generated because the default behavior lies? Too bad.

Matplotlib is ugly, but it doesn't make decisions for you, and once you understand it, you can do anything with it.

A library should make the common things easy and complex things possible.

Matplotlib makes everything complex.

While writing my thesis I found matplotlib to be quite beautiful with adjustments only on the text (use LaTeX rendering to fit in with the thesis doc itself) and colour schemes; that is literally three lines of code at most. It's not ugly by default either, it produces very crisp graphics easily.
Beauty is in the eye of the beholder, I guess. I wouldn't put matplotlib graphs in a paper without tweaking the style, and it gets frustrating when you have to do this for every single plotting script you write. And the defaults certainly aren't colourblind-friendly.
eh, you know, you can put your styles in a rc-file? and yeah, you have to load your defaults every single script (though you have to do that with every tool?!)
Isn't it amazing how truly bad matplotlib is?

And it gets worse because it gets new APIs with almost identical names to the previous ones, without a proper guide for when to chose which API.

And yes it's just so ugly by default.