Gnuplot gets iterators

Posted by matt
on Monday, November 10

Whilst looking at the gnuplot website, I discovered the demo page, which shows, amongst other things, new features in the CVS version.

The main that caught my eye was the plot on the right, which shows a few overlaid sinusoids, with the code used to generate them as the key. Here’s the code:

plot for [n=2:10] sin(x*n)/n with filledcurves

That’s right, one line for 8 plots! Version 4.3 of gnuplot introduces the for keyword, which lets you sweep through numerical parameters and loop through strings. The help (see help iteration with 4.3) has a few examples, which I’ve copied in below:

plot for [filename in "A.dat B.dat C.dat"] filename using 1:2 with lines
plot for [basename in "A B C"] basename.".dat" using 1:2 with lines
set for [i = 1:10] style line i lc rgb "blue"
unset for [tag = 100:200] label tag

I downloaded and compiled the sources and whipped up a quick example of my own (I couldn’t get aquaterm going though). You can see it below:

gnuplot has iterators!
Uploaded with plasq’s Skitch!

I’ve got preliminary support going in the Gnuplot TextMate bundle, but I’m still not 100% happy with it yet.

Screencast: Using the Gnuplot TextMate Bundle

Posted by matt
on Sunday, November 09

I had so much fun making my previous screencast, on installing the Gnuplot TextMate bundle, that I decided to make another one. This one is about using the bundle. It includes info on snippets and commands, as well as the TM_GNUPLOT variable I introduced. Setting this variable allows you to choose the gnuplot executable.

View it below, on Vimeo directly, or download it.


Using the Gnuplot TextMate Bundle from Matt Foster on Vimeo.

Please leave comments as feedback!

Screencast: Gnuplot TextMate Bundle

Posted by matt
on Friday, November 07

I proudly present: my first foray into screencasting!

After months of umming and ahhing I finally decided to get a copy of screenflow (partially for Christmas, and with a nice educational discount!).

To ease myself into it, I decided to start with something simple, so I ended up with how to download and install my Gnuplot bundle for TextMate.


Installing Gnuplot TextMate Bundle from Matt Foster on Vimeo.

Please leave your comments below, and I’ll try to address them.

Update: as Dunc points out below, you’ll need to enable the unstable repositories in fink. You can do this by running fink configure, and telling it to enable unstable access.

Getting a working Gnuplot for the TextMate bundle

Posted by matt
on Monday, September 01

I’ve been looking at getting a good build of gnuplot with everything I need for the bundle, and so I’ve tried various versions.

My currently recommended way of getting gnuplot is this:

fink install gnuplot-nox

This will automatically build and install a gnuplot with pdflib and aquaterm support, as well as everything else you’re likely to need. This only thing that it misses out it X11 support, which I don’t want and you probably don’t either! Aquaterm is a lot more convenient, and fast. Unfortunately, there’s isn’t a binary build of this in `fink` yet, but fingers crossed that there will be soon.

I’ve put this information in a wiki page on GitHub. I’ll try and keep that up to date with my current recommendation.

Another Gnuplot Bundle!

Posted by matt
on Tuesday, July 29

Whilst surfing GitHub, the new standard repository for all of the World’s cool repositories, I stumbled across gnuplot-textmate-bundle – another Gnuplot bundle for TextMate.

So far I’ve only had time for a quick look, but my initial thoughts are that it is less complete than my bundle, but with better commands. Their run command uses a ruby helper script, which looks quite cool. There’s also some usefulness in the form of a Rake script. Most of it seems to focus on eps files though, which isn’t really general enough for me, but it looks quite robust. In particular, I like the idea of stripping out the output parts for previewing in aquaterm.

Anyway, there’s some cool ideas there, and as a scary professor I know one said… “We don’t work in a vacuum, you know.”