This post originated from an RSS feed registered with Python Buzz
by maxim khesin.
Original Post: matplotlib recovered
Feed Title: python and the web
Feed URL: http://feeds.feedburner.com/PythonAndTheWeb
Feed Description: blog dedicated to python and the networks we live in
Well, I was writing about matplotlib and then went away from my computer for a while. Then I came back, edited the post and clicked Publish. In return Blogger gave me a nice "Login" page. I logged in. Data - gone. Now Publish function is using POST. Another words, I sent my data to Blogger, and they made it fall off the cliff. Why not retain the POSTed data and recover it when I log in again? Beats me. They do have some kind of a farkakte recovery mechanism, which could may be work if you use it within 1/2 hr of loosing your post. I'll never know, it was too late for me :(. Anyway, back to the original post.
I recently had an occasion to tinker some with matplotlib, which is the most recommended Python plotting package. It has an interesting history, which has become somewhat archetypal open source story. Goes someting like this: "Was using Matlab. Wanted to work with python. Made matplotlib". This is the stuff that separates the men from the boys (like me).
Matplotlib is very powerful and pretty easy to learn. I would recommend tweaking the examples. They have a zipped package of examples, but the best format for their examples is actually on the screenshots page - there is a picture and a piece of code that created it. I wish all of them were like it - it is really easy to look for the plot elements you want and then look up the code that's needed.
The only thing that sorta kept weirding me out is the prima facia absense of an object model. You just call plot() xlabel(), ylabel(), stuff like that. Seemed unpythonic. Well, the object model is there, it's just hidden by default, and the convenience layer is built on top of it. You may want to look up Matplotlib users' manual section 2.5 - if you are like me, it will put your mind at rest.