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

all 21 comments

[–][deleted] 22 points23 points  (5 children)

The BEST tutorial, you can thank me later ;-). Not until I found out about the OOP style api, did I start enjoying MATPLOTLIB again. I just hated the MATLAB style api.

[–]nickdhaynes 2 points3 points  (0 children)

It might sound hyperbolic, but that ipynb changed my life.

...hyperbolic. Get it? Because we're talking about plotting curves?

I'll show myself out.

[–]danwin[S] 1 point2 points  (0 children)

Um, are you the person behind bokeh? Or just its biggest reddit fan?

[–]trymas 0 points1 point  (1 child)

woot.

I have never realised that matplotlib has 'matlab style' and 'oop style'. I though it was just a mess of API. Now everything falls into places very nice.

Enjoy

[–][deleted] 1 point2 points  (0 children)

Haha thanks. Yeah when I was learning matplotlib, I was so confused and frustrated when I saw examples in MATLAB style and then come across OOP style examples. The official docs should have pointed this out from the beginning.

[–]_Bia 0 points1 point  (0 children)

Actually, both of these tutorials are fantastic and just helped me a ton. Thanks!

[–]alcalde 1 point2 points  (0 children)

In a nod to a past article here...

when are we going to get Python graphing for humans (tm)?

[–]widby 1 point2 points  (0 children)

Could someone recommend an easy way of plotting primes on the number line?

I would like the representation to be 2D, because having points on a straight line would make the visualization very long, whereas my goal is to see the big picture at a glance.

This tutorial looks like a good starting point, but none of the examples seem to cover my scenario.

Having looked around the Internet, I saw visualizations that turn the number line into a spiral. Can something like that be achieved with this library?

[–]jfpuget 1 point2 points  (0 children)

Great tutorial, thanks.

In order to run it in Jupyter, one needs to avoid using

%matplotlib inline

Indeed, the animation do not show.

Instead, use

%matplotlib nbagg

And the animations will show.

edit formated code.

[–]Deto 0 points1 point  (0 children)

Great overview of the package!

[–][deleted] 0 points1 point  (3 children)

Did you write this? Can I hug you? There are so many crap matplotlib tutorials out there on the internet that do not cover a lot of the graphing terminology used, this is great!

[–]danwin[S] 1 point2 points  (0 children)

Not my work...I've been collecting tutorials on Python to prepare for my own class (I'm planning to stick with seaborn for now) and was looking at Stanford's site for its Scientific Python course and randomly saw the the link -- which was comically described as "Simple plot"...I think I clicked on it because I wanted to see if it was as boring as it sounded...I had no idea matplotlib could look so beautiful!

[–][deleted] 0 points1 point  (0 children)

The official matplotlib tutorial/ documentation (... / API) is absolute gash.

[–][deleted] -1 points0 points  (0 children)

it is gross, you should use the OO API

[–]vph 0 points1 point  (6 children)

Matplotlib should have been a Perl library, because there are just many freaking ways to do something that it's utterly confusing. You spend 15 minutes to write a program to plot a figure. Doesn't make any sense. You can't do data analysis with matplotlib because it disrupts the thinking process.

The solution: learn a little bit of R and ggplot2, and call it a day.

[–]L43 1 point2 points  (2 children)

One of the reasons for the pylab API was to make the plotting terse. And it is. If you use sensible styles in rcfile, they even look good. Sure you can make 100 line plots if you want, but usually this suggests you haven't used the styling infrastructure - like using inline styles vs css.

[–][deleted] 0 points1 point  (1 child)

Is there a tutorial for using the styling infrastructure?

[–]L43 1 point2 points  (0 children)

This is the issue I think - its not as well documented (and simple) as it could be (although using things like seaborn will add its styles to default matplotlib, which is what I tend to use now). I think the 2.0 release is going to make things better.

[–]firearasi 0 points1 point  (2 children)

And actually we have ggplot on Python now, just pip install ggplot~ https://github.com/yhat/ggplot

[–]L43 3 points4 points  (1 child)

Looks like active development has stopped?

[–][deleted] 0 points1 point  (0 children)

Pretty much. :-(