Am 30.03.2021 um 15:41 schrieb Alecos Papadopoulos:
The more "few lines of code" in the manual the better.
Apart from the basic logic of a command or a script, these "few lines
of code" reveal also the little things around scripting (the correct
placement of "punctuation marks" of the scripting language, so to
speak), that some times can drive less knowledgeable users crazy.
In the meantime, for reference let me simply copy-n-paste the few lines
of code from Artur's plot_scatter_label package
<hansl>
function string AddLabel (series Y,
series X,
strings LABEL)
matrix XY = {Y}~{X}
string S = ""
loop i=1..rows(XY) -q
sprintf s "set label $i '%s' at %.4f-0.1, %.4f-0.2 centre font
',10' ; ", LABEL[$i], XY[i,2],XY[i,1]
S += s
endloop
return S
end function
</hansl>
Notice that this code is not "hansl state of the art", for example the
"sprintf" command is deprecated - you should use the function form
instead. And probably you would use LABEL[i] instead of LABEL[$i]. But
that's not the motivation for Artur's decision, I think.
cheers
sven