Tuesday 27 March 2012

Padding for superscript and subscript axis labels in gnuplot

By default gnuplot doesn't align superscripts and subscripts:
T_c^{/Symbol \245}

But, that leaves an ugly space between the symbol and superscript. You can force alignment with an @ character:

T@_c^{/Symbol \245}
 This works fine for standard characters, but for slanted variables, the align character makes the superscript overlap. To fix this we insert a partial before the infty symbol in the superscript. To do this we combine two text effects, blank characters &{a} and font size scaling {/* }:

T@_c^{{/*0.5 &{c}}{/Symbol \245}}

To give the desired result. You can change the factor 0.5 to whatever you need, with 1.0 being full character width.

Tuesday 20 March 2012

Bash function to wget from user space in york

This can be placed in .bashrc and can be used to get a file from (your username abc500)

http://www-users.york.ac.uk/~abc500

(this is on unix0 in the web directory.

wgetyork ()
{
if [ -f "$1" ];then
rm "$1";
fi
wget http://www-users.york.ac.uk/~abc500/"$1"
}

it checks for the file because wget will save the file you download as filename.1 if you already have a file called filename. Call it using

wgetyork filename