Tabula Rasa » science
home mail us syndication

Archive for science

Crazy Matplotlib tutorial

I started using python’s matplotlib to plot graphs in my Oceanography courses. Matplotlib is pretty easy to understand if you already know some python. However it’s documentation is somewhat frustrating, even though it comes with a plethora of examples.

So I turned to seek help on the user’s list, and that was a great experience. I got responses almost immediately, and many times the respondent was the author of the program himself. That was very nice, but people kept telling me I should read the tutorial and user guide and I kept answering that I prefer to learn by doing. Which is true. I use another program which has a steep learning curve called latex-beamer. It comes with a wonderful 300+ pages user guide. I read bits and parts of it. But mostly, I just saw other people code and copied it and changed it to fit my own presentation needs. Unfortunately, I couldn’t do the same with Matplotlib, maybe because graph codes is not something people show around like beamer presentation.

So I ended up quite frustrated and I wrote the following to the mailing list:

I am a lost case about reading tutorial at the moment.
I am in a middle of a very intense course, and they expect us to do crazy stuff with matlab. so it’s either that or solving with python. I’ll do read it when I have time…

I am mostly frustrated with documentation writers who write very nice tutorials describing
how to plot completely unuseful graphs of spheres inside loops and a dolphin swimming
in the middle. Come on, this is not what users need. I am talking about what many students
feel. We need real tutorials, this why I wrote my own little tutorial here

So I vented a lit bit my frustration. The reply didn’t wait long before arriving in a very funny way:

Read the rest of this entry »

Data analysis with Programming

Last time I wrote about the disadventages of using a spreadsheet program to analyze large amounts of data, espcially when it comes to important data. Well, as I already said I decided to learn some programming language to do the task. So last week I was working on my homework in the course of Oceanography. Our teacher gave us an excel file containing oceanographic data from the Red Sea, Golf of Eilat (or Aqaba if you prefer). Our task was to present graphs of salinty and potential temperatue, and potential vs. pressure and do some oher calculations regarding our course. So I found my self dragging my mouse endlessly and fighting with excel to plot those graphs. I personally prefer working with Gnumeric, but this file contained some macros to calculate the potential density of the water. So after I submitted the excercise I decided it is time to learn a programing language to do the mission. Since I aleady know python, I thought that matplotlib will be a good choice.

What can I tell you, learning it and ploting my first graphs was quicker then opening excel any spreadsheet. The website has a really good tutorial and for advanced cases you can always get help from the freindly people on the project’s mailing list.

Here is a short tutorial describing how I did my first oceanographic plot with matplotlib. Read the rest of this entry »

Data analysis with spreatsheets vs. programing interface

In many cases people use programs like excel, gnumeric or openoffice spread sheet to analyze large amounts of data. I always hated excel, and when I switched to Linux about 3 years ago I learned about gnumeric, but I always found it a little bit limited because I couldn’t use macros.

Gradually I learned to program and then I realized that I can process large amount of data with different programming languages. I also encountered programs like Octave and Matlab. So whats the big deal about it ?

Well alot! First of all when you work with spreadsheets you actually work on your data. This can harm important raw data and modify it. In many cases it is not very smart to actually work on your data. Second, I always found the way I plotted graph in spreadsheets very cumbersome.

Read the rest of this entry »