Floating Sun » Tools http://floatingsun.net Mon, 07 Jan 2013 02:53:26 +0000 en-US hourly 1 http://wordpress.org/?v=3.5.1 Quicksilver alternatives for Linux http://floatingsun.net/2007/12/06/quicksilver-alternatives-for-linux/?utm_source=rss&utm_medium=rss&utm_campaign=quicksilver-alternatives-for-linux http://floatingsun.net/2007/12/06/quicksilver-alternatives-for-linux/#comments Thu, 06 Dec 2007 19:58:15 +0000 Diwaker Gupta http://floatingsun.net/2007/12/06/quicksilver-alternatives-for-linux Quicksilver_%28software%29|Quicksilver]]. If you don’t know [[http://docs.blacktree.com/quicksilver/what_is_quicksilver|what it is]], shame on you and you can’t call your self a geek. In either case, you should check out [[http://video.google.com/videoplay?docid=8493378861634507068&q=quicksilver&total=2518&start=0&num=10&so=0&type=search&plindex=1|this Google Tech Talk on Quicksilver]] by its creator. While Quicksilver rules supreme as the king of universal access and action applications, what are Linux users supposed [...] ]]>
Everyone loves [[wp>Quicksilver_%28software%29|Quicksilver]]. If you don’t know [[http://docs.blacktree.com/quicksilver/what_is_quicksilver|what it is]], shame on you and you can’t call your self a geek. In either case, you should check out [[http://video.google.com/videoplay?docid=8493378861634507068&q=quicksilver&total=2518&start=0&num=10&so=0&type=search&plindex=1|this Google Tech Talk on Quicksilver]] by its creator.

While Quicksilver rules supreme as the king of universal access and action applications, what are Linux users supposed to do? Sit back and watch in painful agony as Mac users the world over gloat smugly with their shiny little toys? Hell no! I’m going to tell you about some Quicksilver alternatives (probably not as good though) for Linux. There do exist some alternatives for Windows as well, but that’s not the focus of this article.

**GNOME Do**

[[http://do.davebsd.com/|{{http://floatingsun.net/wordpress/wp-content/uploads/2007/12/do.png|GNOME Do}}]]

GNOME Do is a fairly recent entry in this already crowded space. [[http://video.google.com/videoplay?docid=-778606980239491978&hl=en|Here is a screencast]] that shows Do in action. It is being actively developed (and hopefully that continues!) by [[http://blog.davebsd.com/|David Siegel]], a CS student at UPenn. The interface and features seem to highly inspired by Quicksilver, which I think is a great thing. Now if only it wasn’t so tied into GNOME. See my wish list later in the post.

From the website:


//GNOME Do allows you to quickly search for many objects present in your GNOME desktop environment (applications, Evolution contacts, Firefox bookmarks, files, artists and albums in Rhythmbox, Pidgin buddies) and perform commonly used commands on those objects (Run, Open, Email, Chat, Play, etc.).//

**GNOME Launchbox**

GNOME Launchbox is a slightly older effort (and one of the inspirations for GNOME Do). It was started by some developers at [[http://www.imendio.com/|Imendio]] but seems to have fizzled out after an initial burst of activity. The interface is again very Quicksilver-ish.

From the website:


//Launch Box is generally an application launcher. It’s very influenced by Quicksilver for Mac OSX. Remember that this is only a first release so don’t get your hopes up too much. Launch Box is written for the GNOME 2.10 platform and depends on GTK+ 2.6, evolution-data-server 1.2 and gnome-menus. These are currently hard dependencies but the plan is to split out the backends into different optional backends.//

**Katapult**

[[http://katapult.kde.org|Katapult]] started it’s life as an application on
[[http://kde-apps.org|KDE Apps]] around an year back. Since then it has
shifted it’s home a few times, finally landing up on kde.org as an “official”
project.

[[http://katapult.kde.org/|{{http://floatingsun.net/wordpress/wp-content/uploads/2007/12/katapult.png|Katapult}}]]

From the KDE-Apps page:


//Katapult is an application for KDE, written in C++, designed to allow faster access to applications, bookmarks, and other items. It is plugin-based, so it can launch anything that is has a plugin for. Its display is driven by plugins as well, so its appearance is completely customizable. It was inspired by Quicksilver for OS X.//

Of all the applications mentioned thus far, I really only have used Katapult
and that too not a whole lot. But over all my experience has not been that
great. I mean it’s nice as an application launcher (and even then it is
sometimes quite slow), but I didn’t find much use for anything else
(calculator?!). Also, it didn’t play (and I don’t think it still does) well
with Compiz and friends (read ugly display).

**Deskbar Applet**

This is another GNOME centric application, probably the least inspired by
Quicksilver in terms of design and interface. I guess you could say it is more
like Spotlight in some respects.

[[http://raphael.slinckx.net/deskbar/|{{http://floatingsun.net/wordpress/wp-content/uploads/2007/12/launchbox.png|Deskbar Applet}}]]

From the website:


//The goal of DeskbarApplet is to provide an omnipresent versatile search interface. By typing search terms into the deskbar entry in your panel you are presented with the search results as you type.Seaches are handled by a series of plugins. DeskbarApplet provides a simple interface to manage these plugins to provide you with the search results that fit your needs.//

A new kid on the block, the “KRunner” application in the upcoming KDE4 release promises to be a better replacement for Katapult and the current KDE Run dialog. Unfortunately there is no single web page I can point to, and screenshots are spread all over the place. Besides, it is still very much in development and while I have toyed with it a little bit in my KDE 4 session, I really haven’t used it seriously.

**WISH LIST**

So finally, here is my wish list:

* As with most applications in Linux, there is an initial outburst of applications to satisfy similar needs and user requirements. This confounds a lot of new users. Eventually, over time, one or two applications emerge victorious (there are exceptions, of course) but this is a gradual process of absorption, refinement and elimination. I would really love to see a single (or may be two at most) application combining the best technologies at hand (say GNOME Do, and KDE4 Krunner)
* Imitation is the best form of flattery: Quicksilver has gotten to where it is only with extensive community feedback. The model, plugins and user interface it has is PROVEN to work. Don’t try to reinvent the wheel. Steal concepts where possible and relevant! I can’t wait for the day when I will be able to brag about my increase in productivity because of this! Or be able to operate my entire work flow using a single interface: universal access and control baby! :-)

]]>
http://floatingsun.net/2007/12/06/quicksilver-alternatives-for-linux/feed/ 10
RTM has the best Christmas gift! http://floatingsun.net/2006/12/27/rtm-has-the-best-christmas-gift/?utm_source=rss&utm_medium=rss&utm_campaign=rtm-has-the-best-christmas-gift http://floatingsun.net/2006/12/27/rtm-has-the-best-christmas-gift/#comments Thu, 28 Dec 2006 02:17:50 +0000 Diwaker Gupta http://floatingsun.net/blog/2006/12/27/783/ Related posts:
  1. Why isn’t Google killing Ringo and Plaxo?
  2. Merry Christmas
  3. PIM Online
]]>

I use [[http://calendar.google.com|Google Calendar]] to manage my day, and [[http://rememberthemilk.com|Remember the Milk]] (henceforth RTM) to manage my todo list(s). Google calendar has effectively killed off all competition (like [[http://30boxes.com|30 Boxes]]), and its really becoming a joy to use as they improve integration with GMail and other services. Meanwhile RTM is probably the only other web app that I use on a daily basis — its fast, I //love// the keyboard shortcuts, the notifications work great and it basically stays out of my way. The only problem was having to use two different tools (Google and RTM) for such closely related tasks (calendar and todo lists).

So yesterday when I read about the [[http://blog.rememberthemilk.com/2006/11/add-your-tasks-to-google-calendar.html|new RTM integration with Google calendar]], I was elated! Take a look at the screenshots, this is wickedly cool. This was definitely one of my happiest moments over Christmas, so thanks a ton to the RTM team. And if you’re about to suggest that I use the so-called TODO list provided by Google Calendar or one of the Google widgets, forget about it. They don’t even come close to RTM in terms of ease of use or functionality. And with this integration, they’ve just nailed it.

Here’s an overview of the features (from the post linked above):


* Review your tasks for the day
* Add new tasks and edit existing ones
* Easily complete and postpone tasks
* Review your overdue tasks
* Optionally show tasks with no due date
* See where your tasks are located on a map

Happy holidays!

]]>
http://floatingsun.net/2006/12/27/rtm-has-the-best-christmas-gift/feed/ 3
Tools I use: qalculate http://floatingsun.net/2006/06/24/tools-i-use-qalculate/?utm_source=rss&utm_medium=rss&utm_campaign=tools-i-use-qalculate http://floatingsun.net/2006/06/24/tools-i-use-qalculate/#comments Sat, 24 Jun 2006 19:45:56 +0000 Diwaker Gupta http://floatingsun.net/blog/2006/06/24/671/ Related posts:
  1. Tools I use: matplotlib
  2. New look
  3. Tools I use: screen
]]>

[[http://qalculate.sf.net|Qalculate]]’s tagline says “the ultimate desktop calculator”. Might sound a little obnoxious, but it really is and I’ll show some of the really neat features that make it so. Do give it a try and you’ll plenty more!

So what is qalculate? First and foremost, its a calculator. Which means that it can do what you typically expect a calculator to do, no surprises there. Here’s a screenshot of the main window. There’s a convinient history window as well, and a handy keypad if you should need it.
[[http://floatingsun.net/gallery/v/stream/qalculate-1.png.html|{{ http://floatingsun.net/gallery/d/1144-2/qalculate-1.png}}]]

[[http://floatingsun.net/gallery/v/stream/qalculate-2.png.html|{{ http://floatingsun.net/gallery/d/1146-2/qalculate-2.png}}]]

But I’ve never had to use the keypad because the one truly great thing about qalculate is the input mechanism — its extremely smart, context sensitive and natural language oriented. So converting 50 kgs to lbs is as simple as typing “50 kgs to lbs”! And if you don’t know how to represent a unit (pounds or lbs), not to worry, qalculate will provide completion options as you go along:

[[http://floatingsun.net/gallery/v/stream/qalculate-4.png.html|{{ http://floatingsun.net/gallery/d/1150-2/qalculate-4.png}}]]

And then qalculate can be used to do a lot of other things: simplify algebraic expression, solve equations (I believe it can do some calculus as well), a plethora of banking related functions (compute accrued interest etc), lots and lots of geometry related stuff.

[[http://floatingsun.net/gallery/v/stream/qalculate-6.png.html|{{ http://floatingsun.net/gallery/d/1154-2/qalculate-6.png}}]]

Check out the [[http://qalculate.sourceforge.net/features.html|full feature list]], and also take a look at some of the [[http://qalculate.sourceforge.net/screenshots.html|screenshots]]. I love this thing!

]]>
http://floatingsun.net/2006/06/24/tools-i-use-qalculate/feed/ 3
Tools I use: dirvish http://floatingsun.net/2006/05/16/tools-i-use-dirvish/?utm_source=rss&utm_medium=rss&utm_campaign=tools-i-use-dirvish http://floatingsun.net/2006/05/16/tools-i-use-dirvish/#comments Tue, 16 May 2006 08:00:01 +0000 Diwaker Gupta http://floatingsun.net/blog/2006/05/16/648/ Related posts:
  1. Tools I use: matplotlib
  2. Tools I use: screen
  3. Tools I use: qalculate
]]>

A long time back I bought a large hard drive (well, it doesn’t look so large any more, its only 160GB. But it did seem very large then). My primary motivation behind buying the drive was to backup my data. So I started looking around for backup solution. I had the following requirements:
* easy to setup and configure: defaults should largely work out of the box.
* support for incremental backups: don’t make a full copy of the file system every time I change a single file.
* support for multiple backups: I want daily backups going back one week, backups from the 1st of each month for the past year, and backups for 1st Jan on every year for the past 5 years. You get the idea — exponentially decreasing density of the snapshots.
* regular file systems for backup: I don’t want to use a special interface to browse the backup. I don’t want to untar/unzip/whatever to look at my backup. I want to be able to ”cd” into ”2006-01-03” and look at the backup for that date.

The first problem I ran into was the number of solutions available. I think there are easily upwards of 50 decent open source backup solutions out there. To name a few: there are some fairly simple ones such as [[http://konserve.sourceforge.net/|konserve]]; some of average complexity such as [[http://www.dirvish.org/|dirvish]], [[http://www.nongnu.org/rdiff-backup/|rdiff-backup]], and [[http://www.nongnu.org/duplicity/|duplicity]]; and finally some complex behemoths like [[http://www.amanda.org/|amanda]], [[http://www.bacula.org/|bacula]] and [[http://backuppc.sourceforge.net/|backuppc]].

After some experimentation, I settled on dirvish. To be fair, I did nothing close to an exhaustive evaluation. All systems did not get a fair chance, and dirvish might just have gotten lucky in that it was the first system I seriously tried. But its been working fairly well for me so far.

dirvish meets all of the requirements that I’ve stated above. Its written in Perl, which is unfortunate since I don’t appreciate perl all that much. But so long as I don’t have to look at the code, I don’t really care. It can do incremental backups to local or remote devices. Its extremely configurable in terms of the backup density thing I mentioned earlier. You can browse backups like normal filesystems. It makes efficient use of space, hard-linking common files where possible. It can take care of deleting old backups etc. It works well over rsync or ssh.

I tried backuppc, but it requires a web browser to look through and retrieve files from the backup. rdiff-backup and duplicity just build on top of rsync and didn’t seem to provide the kind of flexible configuration I was looking for. Amanda and bacula just seemed too much of an overkill for my modest needs. As always, YMMV, but I recommend dirvish for laptop backup kind of needs.

]]>
http://floatingsun.net/2006/05/16/tools-i-use-dirvish/feed/ 2
Tools I use: beamer http://floatingsun.net/2006/05/15/tools-i-use-beamer/?utm_source=rss&utm_medium=rss&utm_campaign=tools-i-use-beamer http://floatingsun.net/2006/05/15/tools-i-use-beamer/#comments Tue, 16 May 2006 07:32:02 +0000 Diwaker Gupta http://floatingsun.net/blog/2006/05/15/647/ Related posts:
  1. Why beamer?
  2. Its been a long time…
  3. More Vim tools
]]>
This is largely a rip-off of my original article. I figured I should repost it for posterity and it fits in line with my tools theme.

Being a grad student (for that matter, in almost any profession these days), I frequently need to give talks or present some material. I have finally settled on Latex Beamer as my preferred presentation tool, and this article describes why.

Introduction

Presentation is one of the most effective means of communication for a small audience with diverse backgrounds. Both in the industry and the acedemia, it is becoming increasingly important to create affective and compelling presentations. Not surprisingly then, the presentation tool you use becomes very important in the work place.

The de facto tool for presentation out there is Microsoft Powerpoint. For more reasons than one, I prefer not to use it. I have tried several alternatives, and finally decided to use Latex Beamer for my presentations. Here I try to describe why I made this choice. I must mention here that the beamer web page looks ostentiously simple and naive — don’t be fooled by it. Beamer is one of the most sophisticated and extensively documented (user manual has more than 300 pages of professionally written documentation) presentation tools I have come across. Take a look at one of the sample slides to get a feel of what beamer can do.

Things I dislike about other presentation tools

While I’m not talking about any one tool in particular, the general flavor is of tools belonging to the Powerpoint family (this includes OpenOffice.org’s Impress, KOffice‘s KPresenter etc)

  • I have to worry about layout
  • Font sizes are a function of amount of content
  • Changing parts of a “theme” is hard
  • Powerpoint slides won’t run nicely on Impress or KOffice. The latter two won’t run at all on Powerpoint. Why do I need something as bulky as powerpoint just to do the presentation? While making, I can understand that we might need significant software complexity, but can’t we have something more lightweight for presenting?

Things I like about beamer?

  • Its LaTeX: latex and friends have survived the test of time and for more than 2 decades people have been using tex derived technologies for typesetting their writings. With latex, beamer makes it easier than ever to put mathematical formualae and all kinds of symbols in your presentations, embed images, make tables and do everything else that you can do with latex. Since many of us already use latex, it means there is less tool to learn — I can make my presentations in a language that I’m already familiar with! And I don’t need any bulky tool to manipulate my presentation, just a text editor is enough, thank you.
  • Its PDF: We all know what PDF stands for — Portable Document Format. Thats it! Portable! Latex runs on all major operating systems and architectures out there. Once you get a PDF from Latex, you can display it using any regular PDF viewer. Imagine how easy it now becomes to move your presentation around. You don’t have to worry if your laptop breaks down and the other laptops in the room don’t have the right version of Powerpoint installed. Put your PDF in a USB key and stop worrying about it!
  • Takes care of layout
  • Themes are endlessly customizable: beamer comes with dozens of pre-packages themes, and its very easy to modify an existing theme. Same thing with fonts and colors (you can even do alpha transparency!)
  • Notes and handouts made the way you want them
  • Organize your presentation in a logical manner: beamer sort of follows the MVC philosophy. In each presentation, there is a content structure, which determines how your content flows through (just like a regular article with sections and subsections). Then there is a slide structure, which determines how this content fits onto your slides. The content structure controls the generation of navitation and table of contents. The slide structure controls the slides and the control flow between them.
  • Amazing documentation: The beamer user manual is over 200 pages long, and its all good solid documentation. It is amazing well written considering the fact that its mostly done by a single person. It starts off with a nice tutorial, followed by detailed references and examples.
  • Accompanying packages: Just check out the documentations for xcolor and pgf. The documentation is just as comprehensive as beamer itself, and these packages make it easy and fun to do fancy stuff with beamer. Like draw pretty pictures and do some basic animation. Again, all with the comfort of latex.

But nothing is perfect

  • No knowledge of projectors or screens — the user has to deal with that (or the operating system)
  • Animation is still hard.
  • In general, multimedia is hard: embedding audio and video clips may not work reliably on all platforms.

I highly recommend beamer to anyone who wants to try an alternative to Powerpoint, and if you write a lot of technical papers in latex, you’ll immediately love beamer. Check out my NSDI talk for a sample of what beamer can do for you.

]]>
http://floatingsun.net/2006/05/15/tools-i-use-beamer/feed/ 1
Tools I use: screen http://floatingsun.net/2006/03/21/tools-i-use-screen/?utm_source=rss&utm_medium=rss&utm_campaign=tools-i-use-screen http://floatingsun.net/2006/03/21/tools-i-use-screen/#comments Wed, 22 Mar 2006 05:56:31 +0000 Diwaker Gupta http://floatingsun.net/blog/2006/03/21/599/ Related posts:
  1. Tools I use: tmux
  2. Center screen on current line
  3. Tools I use: dirvish
]]>

The [[http://www.gnu.org/software/screen/|screen website]] introduces screen thus:

//Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.//

But I don’t think it does justice to the utility of screen. Let me try to simply the introduction a little bit and motivate the usefulness of screen with some examples.

Lets say you started some long running simulation in your lab (for instance, a shell script that calls your main routine with different parameters; then collects/collates the data and also plots it). Now you leave it running and come back home with the hope that when you come in next morning, everything would be done.

But if something goes wrong in between, how do you find out? One cheap way to do this is to use ”nohup” and redirect the output of the process to some log file, and inspect the log file from home. But this is not neat. Ideally, you want to be able to interact with the process as if it was running locally (keystrokes and everything).

More importantly, how do you recover from failures? Say your script gets hung somewhere, and it needs some input to proceed. How do you do it from home? You can of course use remote desktop solutions such as VNC, but they typically have high bandwidth requirements, and are almost unusable over slow networks (as are to be found at most homes. Yes, that includes DSL and cable).

Basically, screen lets you run multiple shells, and “detach” them. Later on, you can simply SSH to your machine, and “reattach” your screen session and have your console workspace restored just as it was. You can monitor and interact with your jobs as if they were running locally. In some sense then, screen is a poor man’s version of full fledged remote desktop protocols, since it basically does the same thing for consoles.

But screen can be used for a lot of other things as well. As the introduction says, screen is a window manager. What that means is that you can have multiple “windows” within a single screen (think of them as buffers in an editor, or just multiple shells that you can switch between). You can split up the screen to display multiple windows at once. This is very convinient if you are editing your script in one window and executing it in another while tailing a log file in a third window, for instance.

Another popular use for screen is for doing collaborative editing. Screen’s can be shared across mutliple users, and so multiple parties can communicate using a single screen. You can edit a report together with your project partners, or just keep an eye on what your friends are typing ;-).

Finally, screen is infinitely configurable. Do ”man screenrc” for details. Here is a basic configuration file to get you started, save it as ”~/.screenrc”:


# no annoying audible bell, please
vbell on

# detach on hangup
autodetach on

# don't display the copyright page
startup_message off

# caption
caption always "%w"

# hardstatus
hardstatus alwayslastline "%H %C%a %M %d, %Y Load: %l "

]]>
http://floatingsun.net/2006/03/21/tools-i-use-screen/feed/ 3
Turbogears rocks http://floatingsun.net/2006/02/17/turbogears-rocks/?utm_source=rss&utm_medium=rss&utm_campaign=turbogears-rocks http://floatingsun.net/2006/02/17/turbogears-rocks/#comments Fri, 17 Feb 2006 08:06:02 +0000 Diwaker Gupta http://floatingsun.net/blog/2006/02/17/558/ Related posts:
  1. amarok rocks!
  2. Naruto rocks!
  3. Textdrive Who’s Who
]]>

So I’ve finally started working on my first serious (serious might be too strong a word, but certainly non-toy) web app using [[http://turbogears.org|Turbogears]]. I don’t want to make this yet another Turbogears vs. X,Y,Z ([[http://rubyonrails.com|Rails]], [[http://www.djangoproject.com/|Django]], put-your-favorite-framework) post — after much reading (and a fairly low signal-to-noise ratio in a lot of such comparisons), I’ve decided that it doesn’t really matter. Functionally, almost all frameworks are more or less equal. Personally, I feel that for small projects, it boils down to personal taste.

For me, Rails was out from the start because I’m a Python guy. I’ve coded extensively in Ruby at one point, but I didn’t enjoy it as much as I enjoy coding Python and thats that. Besides, I’m heavily tied into some tools (such as matplotlib) that just don’t have comparable couterparts in Ruby (yet). To be honest I haven’t looked at Django in any depth, so I can’t make a fair comparison. On the other hand, I //have// been following Turbogears pretty much from its beginnings, although I haven’t tried it in any great depth either.

What it all boiled down to was that I had to pick one of them, any one, and dive in. Stick with it till I run into the meat, and then only I would figure out the strenghs and weaknesses. I chose Turbogears, because I really like the philosophy behind the project. Each of the component projects it itself quite mature. I’ve been tracking the mailing list of TG, and the community is great! There are a lot of smart people who evidently know what they’re doing.

I spent some hours with TG today and I’m really enjoying it. Here are some of the things that I thought were great, but which are not really highlighted as TG features. I think they should be emphasized a bit more, because they’re all pretty significant for any project:

* Extending Jeff Watkin’s [[http://nerd.newburyportion.com/2005/11/updated-identity-framework|identity framework]] was really easy and intuitive. I just derived my own User class from TG_User and thats it! I was all set for using identity!
* I really **loved** [[http://checkandshare.com/catwalk/|Catwalk]]. I mean, I cannot stress how useful it was for me. And how well it has been done. It is the perfect tool when you’re bootstrapping your database and testing your application. The interface is beautiful and intuitive, and even support SQLObject inheritance and joins!
* The entire [[http://turbogears.org/docs/toolbox/|toolbox]] is actually very useful, specially the WidgetBrowser. The things that I didn’t find of much use were the web based Python console and [[http://www.checkandshare.com/modelDesigner/|ModelDesigner]]. I think the latter is actually useful, I just haven’t gotten around to using it yet.
* Widgets: the new widgets are a great way for quickly putting together interactive elements on a page and even displaying data programatically.

So far I haven’t touched [[http://mochikit.com/|Mochikit]] at all, and barely scratched the surface of Kid and CherryPy, but with my experiences so far, I’m really looking forward to digging deeper. A comforting thought is that TG is highly flexible in terms of the components — people have used SQLAlchemy instead of SQLObjects, there are [[http://www.blueskyonmars.com/2006/01/06/template-plugins-for-everyone/|template plugins]] for Cheetah, Stan etc. So if I don’t enjoy this particular combination for some reason, I can atleast hope that my efforts into learning TG will not go to waste — something or the other will work out :-)

]]>
http://floatingsun.net/2006/02/17/turbogears-rocks/feed/ 2
Tools I use: matplotlib http://floatingsun.net/2006/02/07/tools-i-use-matplotlib/?utm_source=rss&utm_medium=rss&utm_campaign=tools-i-use-matplotlib http://floatingsun.net/2006/02/07/tools-i-use-matplotlib/#comments Wed, 08 Feb 2006 07:44:49 +0000 Diwaker Gupta http://floatingsun.net/blog/2006/02/07/530/ Related posts:
  1. More Vim tools
  2. Tools I use: qalculate
  3. Tools for the savvy grad student
]]>

I get a lot of questions along the lines of “Hey Diwaker, what do you use for blah?” (insert your requirement there). Apparently, I seem to have a talent for finding “smart” tools that people like using. So I figured I should blog about some of the tools I used. Maybe others can benefit.

I’ll skip a couple of obvious ones here: my editor of choice is [[http://floatingsun.net/blog/tags/vim|vim]], and I used [[http://floatingsun.net/blog/tags/wordpress|wordpress]] for my blogs.

Let me instead come to something that //every// grad student ends up doing a lot of — making graphs (well, almost every. My friends in theory hardly draw graphs). And frequently, even people outside of research need to make pretty looking graphs and plots. Within academia and researchers, [[http://www.gnuplot.info|gnuplot]] has been the defacto plotting tool for as long as I can remember (I’m pretty sure it goes back atleast a decade, if not more). Outside the research community, most people tend to use the plotting tools that come with Office software — M$ Excel or Powerpoint and the likes.

Don’t even get me started on the Excel/Powerpoint crap. Maybe they are good enough for a quick and dirty work. But for anything more than that, for doing any //real// analysis/visualization, they are pretty much useless. For me, a good tool must meet the following requirements:

* It must be scriptable: I don’t want to have to open a bloated GUI and click a 100 buttons and drag-and-select columns to get a plot out. When dealing with large amounts of data stored in myriads of files, it is **critical** to be able to script/automate the process.
* It must support multiple output formats: EPS, PS, PDF, PNG, JPG, SVG are the ones I usually need. (E)PS/PDF for embedding in papers. PNG/JPG for viewining/emailing. SVG is just cool :-)
* It must support a variety of graph types: bar charts, pie charts, histograms, error bars.
* It should be **highly** customizable: tick size, label fonts, colors, line styles, thicknesses, positioning, subplots, grids, log scales, transparency, marker styles — EVERYTHING.
* Easy things should be **really** easy, and complicated things must be possible.

GNUPlot has served us quite well over the years. Atleast in CSE, I can confidently say that close to 80% of all graphs in papers are done using GNUPlot. In rare cases its OpenOffice/Excel. But GNUPlot is showing its age now: it can only deal with very simplistic input formats, its not very customizable, it supports a very limited number of graph types (AFAIK, it //still// doesn’t support bar charts natively). But for me, the biggest gripe is that it forces me to break my data analysis phase in two steps: in the first phase I write some scripts (typically in Python) to process the raw data into a form that can be consumed by GNUPlot; in the second phase I write another script (in GNUPlot) to do the actual plotting.

Enter [[http://matplotlib.sourceforge.net/|Matplotlib]]: this is easily the **best** plotting library I have ever used. Endlessly customizable, Matplotlib can do almost [[http://matplotlib.sourceforge.net/screenshots.html|any kind of plot you can imagine]] and some more. Apart from the traditional object oriented interface, Matplotlib also gives a very simple MATLAB (R) like interface for easy plotting. The API maintains a high degree of compatibility with MATLAB API, so MATLAB users will feel right at home.

Furthermore, since it is written in Python, it means that I can unify my data analysis — the possibilties are endless. I can feed all kinds of data directly to Matplotlib. I can process, analyze and plot in the same script. I can make my scripts highly generic (since they are in Python, I can pass command line parameters and what not — none of this is possible with GNUPlot).

Here’s a code fragment to make a really simple plot (stolen from [[http://matplotlib.sourceforge.net/tutorial.html|the excellent tutorial]]):


from pylab import *
plot([1,2,3])
xlabel('time')
ylabel('volts')
title('A line')
show()

And, best of all, you get a fabulous, interactive user interface for free! Yes, I know GNUPlot has an interactive mode too, but this is beyond comparison. You can pan, zoom, go back-forward in view history, save and what not. Here’s a screenshot:
{{ http://matplotlib.sourceforge.net/tut/navcontrols2.png?300×200|Toolbar2}}

Finally, since its Python, its very portable. It supports a variety of [[http://matplotlib.sourceforge.net/backends.html|backends]], [[http://matplotlib.sourceforge.net/interactive.html|interfaces with ipython]] and is under active development (at version 0.86 currently). So next time you have to do a plot, consider doing it in style — do it with matplotlib!

]]>
http://floatingsun.net/2006/02/07/tools-i-use-matplotlib/feed/ 14