Showing posts with label gnuplot. Show all posts
Showing posts with label gnuplot. Show all posts

29 September 2007

Quintarelli fa pensare

Stefano pubblica un grafico sull'andamento della popolazione mondiale su grande scala. Io, con la mia solita spocchia, penso:
sì, sì, va bene, ma è l'impressione tipica delle crescite esponenziali prese su scale maggiori del tempo caratteristico: crescita (apparentemente) piatta per un lungo periodo e impennata (apparentemente verticale) improvvisa alla fine. Basta mettere la scala logaritmica alle ordinate e ci si ritrova con una "semplice" retta, tipica di una crescita geometrica. Forse è addirittura qualcosa di ovvio, tipico delle crescite di popolazioni ancora lontane dai limiti imposti dalla disponibilità di risorse...
Il pensiero è una frazione di secondo, ma non impiego più di trenta secondi per arrivare allo stesso grafico sulla wikipedia con tanto di dati nudi e crudi. Altri 10 secondi — cut'n'paste e due righe (set logscale y e plot world-population.txt) di gnuplot — e ho il grafico in scala logaritmica: questo sì che è impressionante!!!
A quel punto non è più questione di secondi e in un attimo mi trovo perso per la wikipedia: dalla catastrofe di Malthus, della rivoluzione verde (sapevate cosa sono le varietà ad alta resa? e che dovrebbero essere più propriamente chiamate varità ad alta risposta?), da cui al picco del petrolio...
Peccato si debba tornare in fretta al lavoro.

25 September 2007

root sucks

You know, root sucks.
Awfully.
Coming from Matlab, I'm just trying Octave. Maybe you want more than the default gnuplot, in order to play around interactively with your graphs (rescaling, zooming, labeling...). Being in a hurry, I was not able to get OctPlot to work (I found X related problem...), but grace works very fine for me. You simply have to type toggle_grace_use at the octave prompt − notice that for me it doesn't work this toggle_grace_use inside kOctave, nor toggle_octplot; both of them works only from the octave terminal prompt. But if you have a frequently used alias for emacs -nw, this is fine :)
Let me play with this mix for more than a few hours in order to see if it could really replace Matlab, at least for not-so-high performance demanding tasks in everyday work...

13 March 2007

gnuplot 4.2 on ubuntu: update

Edo pushes me to take a look at the several options one can select while compiling. The complete list is not so deep (you can find it through ./configure --help, or inside the INSTALL file). Moreover, as a matter of fact, most of them are selected by default (like the useful --enable-history-file and --enable-datastrings, which enables gnuplot to apply a label just near the coordinates of each point of the plot).
Anyway, the one I consider the most useful for the everyday life with gnuplot − namely enabling the GNU readline − is not selected by default. This option enables the gnuplot prompt to act just like a common shell one, provided with its powerful line-editing capabilities (which are taken, as Wikipedia says, from one of GNU's earliest and most popular projects, Emacs!). As usual, life is quite easy with Ubuntu. My previous recipe is still good with two small things.
First of all, make sure to have the libreadline5-dev package installed. If not, it is easy to use apt-get, Synaptic or Adept Manager to find and install it.
Finally, simply add the --with-readline=gnu option to the first ./configure command.
That's all Folks!

09 March 2007

gnuplot 4.2 on ubuntu: right now!

Just a few days ago the new version of gnuplot was released. As you can read from the announce, it has been almost 3 years since release of the previous version 4.0. This new version contains a ton of new features, support for several new output devices, and improved performance. But I don't know how much I'm supposed to wait before the ubuntu guys will include this brand new version into its official repositories. Moreover, if you google for a debian package, you will find no more than the 4.0.0-5 version. So I moved to install gnuplot from sources.
   —   ∴   —   
So I took my tar-ball and unzipped it into a temporary directory:
[hronir@boltzmann:~/gnuplot-src] tar -xzvf gnuplot-4.2.0.tar.gz
[hronir@boltzmann:~/gnuplot-src] cd gnuplot-4.2.0
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0]
To be careful, I decided not to replace the previous instance of gnuplot, so I asked ./configure to take a home-based directory as the --prefix option:
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0] ./configure --prefix=$HOME/gnuplot4.2
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0] make
[hronir@boltzmann:~/gnuplot-src/gnuplot-4.2.0] make install
My first attempt failed just in the last step: it was saying something ending with:
/home/hronir/gnuplot-src/gnuplot-4.2.0/missing: 103: makeinfo: not found
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
make[1]: *** [gnuplot.info] Error 1
make[1]: Leaving directory `/home/hronir/gnuplot-src/gnuplot-4.2.0/docs'
make: *** [install-recursive] Error 1
But it really was a very small hurdle to overcome. As the warning was suggesting, I simply took the Texinfo package from my Adept Manager and at the second attempt with ./configure, make, make install I get my new-gnuplot [›››] (the only comment is that it was not only a warning, since without the Texinfo package it would not complete the installation...)
Last thing: making the new-gnuplot the default gnuplot. First check which gnuplot is your gnuplot:
[hronir@boltzmann:~] which gnuplot
and bind it to some alias of your choice, for example:
[hronir@boltzmann:~] alias gnuplot-old=`which gnuplot` 
Then bind a gnuplot alias to the new-gnuplot, which lies in the bin directory:
[hronir@boltzmann:~] alias gnuplot='$HOME/gnuplot4.2/bin/gnuplot'
and all done!
 
PS
As a matter of fact, the gnuplot-old alias is not needed. When you have an alias which overloads a pre-existing command, you can always recover the original command by pre-posing a backslash to the command itself. In this case, for example, you have:
[hronir@boltzmann:~] gnuplot --version
gnuplot 4.2 patchlevel 0
[hronir@boltzmann:~] \gnuplot --version
gnuplot 4.0 patchlevel 0
and the gnuplot-old alias is pretty useless.