The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 creating vertical line at plot maximum
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

benderrr

Germany
Posts

Posted - 07/19/2005 :  3:37:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: WinXP
Hello,
I have got some hundreds of graphs to do and a lot of work in front of me. I would like to add a vertical dashed line on each graph between the top and bottom x-axis. The vertical line shall serve to help to relate sets of graphs with the same x-axis, but different plot contents to each other. The vertical line shall pe plotted at the x-position, where one special column has its maximum.
Can you help me out with something I could use in the script window? It would be already very helpful to have a script that plots a vertical dashed grey line at a special x-position ranging from top to bottom x-axis.
Maybe it is possible to plot this line as a linear function of type y = xposition and to add the grey dashed style to it? I just do not know how to perform this as a script..
Thanks for your help,
Bender

Mike Buess

USA
3037 Posts

Posted - 07/19/2005 :  3:56:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Bender,

Use LabTalk's draw command. I think the following will do what you want but check the programming guide for details.

draw -w 0.5 -d 1 -l -v X-position;

-l -v X-position >> draws a vertical line from top to bottom at X=X-position
-d 1 >> sets the line pattern to dash
-w 0.5 >> sets the line width to 0.5 (so you can see the dashes)

Mike Buess
Origin WebRing Member
Go to Top of Page

benderrr

Germany
Posts

Posted - 07/19/2005 :  5:01:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,
thank you for the hint. I searched the LabTalk language reference because additionally I'd like to set the line's color, and it says to use the -c # option on draw.
"# equals the numeric position in the color list starting with zero (black = 0, red = 1, green = 2, etc.). "

However, no matter which number I use, for example

draw -c 2 -w 0.5 -d 3 -l -v 3;

the line is still black. Do I have to define a color listing before somewhere?
Best Regards,
Bender
Go to Top of Page

easwar

USA
1964 Posts

Posted - 07/19/2005 :  5:28:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Bender,

The -c option for color does not work as you found out.

For now you could do the following.
Any object such as the line you create has a name. The first line you add to a layer has default name Line, the next has name Line1 etc.

So you can add another line to your code to change color such as:
draw -w 0.5 -d 3 -l -v 3;
line.color=3;

Easwar
OriginLab

Go to Top of Page

greg

USA
1378 Posts

Posted - 07/26/2005 :  2:20:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you name the object when created you can then set the color :

draw -n Mark1 -w 0.5 -d 1 -l -v 5;
Mark1.color=2;

So programmatically ...

NextMark = 1;
...
...
draw -n Mark$(NextMark) -w 0.5 -d 1 -l -v 5;
Mark$(NextMark).color=2;
NextMark++;
...
...


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000