can anyone plz give me a sample on how to use the command "drawline"

many thanks!

manual says

drawling[/w=windowsname]x0,y0,x1,y1

but this does work.


Should work like this (if x0 etc are valid variables)
Did you specify a layer before the drawline command? E.g.
SetDrawLayer UserBack
DrawLine 10,50,500,50

HJ
HJDrescher wrote:
Should work like this (if x0 etc are valid variables)
Did you specify a layer before the drawline command? E.g.
SetDrawLayer UserBack
DrawLine 10,50,500,50

HJ

I didn't specify a layer.

I did similar to the one in your reply which is
drawline[/W='windowname'] 0,9,1,9

but no line is drawn.........
HJDrescher wrote:
Try larger numbers. I guess this will draw just 2 pixels...

ah, so the x0, x1, y0,y1 value there are pixel but not the value on the x axis or y axis?


HJDrescher wrote:
On the 'UserBack' layer it's pixels.

thank you. get it.
HJDrescher wrote:
On the 'UserBack' layer it's pixels.


The layer does not affect the coordinate system.

You may be thinking of panels, where the only options for coordinates are pixels or relative.

In graphs, the coordinates can also be relative, plot relative, or axis-coordinates.

Take a closer look at the SetDrawEnv command's xcoord and ycoord options.

Here's an extract of the Igor 6 documentation (I'm guessing pangeng is using Igor 6):


SetDrawEnv [/W=winName ] keyword [=value ][, keyword [=value ]]...

The SetDrawEnv operation sets properties of the drawing environment.

If one or more draw objects are selected in the top window then the SetDrawEnv command will apply only to those objects.

If no objects are selected and if the keyword save is not used then the command applies only to the next object drawn.

If no objects are selected and if the keyword "save" is used then the command sets the environment for all following objects.

Each draw layer has its own draw environment settings.
...
xcoord=abs X coordinates are absolute window coordinates. The unit of measurement is pixels if the window is a panel, otherwise they are points. xcoord=abs is the default for all windows except graphs where the default is xcoord=prel. The left edge of the window (or of the printable area in a layout) is where x=0.

xcoord=rel X coordinates are relative window coordinates. x=0 is at the left edge of the window; x=1 is at the right edge.

xcoord=prel X coordinates are relative plot rectangle coordinates (graphs only). x=0 is at the left edge of the rectangle; x=1 is at the right edge of the rectangle. This coordinate system ideal for objects that should maintain their size and location relative to the axes, and is the default for graphs.

xcoord=axisName X coordinates are in terms of the named axis (graphs only).
...
[same for ycoord]



--Jim Prouty
Software Engineer, WaveMetrics, Inc.