sfeam, thank you for your reply.
I will provide some more details.
I want to plot the file:
"sprintf.txt"
0.2 1.5970E-01 1.1262E-01
0.4 5.7188E-01 2.2227E-01
0.6 2.2019E-01 4.3648E-01
executing the following script: ./plot_sprintf 20 1
#!/bin/sh
gnuplot << EOF
set terminal postscript eps enhanced
set output 'plot_sprintf.eps'
plot "sprintf.txt" using (\$1):(\$2) w l ls 1 t sprintf('T > %03.0f abc',$1),\
"sprintf.txt" using (\$1):(\$3) w l ls 2 t sprintf('T > %3d abc',$2)
unset table
EOF
After the script execution I get an eps file with the following strings that "don't align properly": they look approximately like this
T > 020 abc
T > 1 abc
instead of looking like this (the way I want):
T > 020 abc
T > 1 abc.
As Hans-Bernhard mentioned I used %d specifier for printing a float, which is of course wrong. Actually all the "floats" I provide for sprintf can be converted into integers (so these floats are 20.0 and 1.0 in the above example). I used %d because I started trial and error method just to get what I want.
P.S.
In the reference it was written:
"Minimum number of characters to be printed. If the value to be printed is shorter than this number, the result is padded with blank spaces. The value is not truncated even if the result is larger."
So specifying sprintf('T > %3.0f abc', 1) I expected to see desired blanks, but I didn't. Than I started applying "everything you can try" method.
By the way sprintf('T > %3.0f abc', 1) did the same job as sprintf('T > %3d abc', 1). However sprintf('T > %5d abc', 1) had the desired output form
T > 020 abc
T > 1 abc
but only for 1 digit numbers.
Sorry, I did a pretty bad job writing my first post.