Hello Johannes
I assume you have a 2D-Axis system.
The easiest way to get the script you ask for is to press <CTRL-A> when you open the dialog box where you can make the setting. Then the complete structure will be recorded and can be insert in your script from the clipboard (or directly in the script if you start the recoding mode of DIAdem)
If you have a Axis-system with the name "2D-Axis1", then use the following script to create a "free legend". For more parameters record the script and press F1 for more details about the variable.
Call GraphObjOpen("2D-Axis1")
'------------------- Swith legend on -------------------------------
D2LEGDRAW =1
D2LEGTXTTYPE ="Free text" ' "ChannelName" or other keywords
D2LEGTXTFREE ="My free legend"
Call GraphObjClose("2D-Axis1")
'redraw
Call Picupdate()
Hope this helps
Winfried