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 for Programming
 LabTalk Forum
 Plot color change after layer -gu
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

FS_S

Germany
4 Posts

Posted - 07/01/2010 :  04:45:06 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8G SR2
Operating System: WinXP

Hi everyone,

I have some problems working with grouped line plots.
I added several plots to one layer using the following sequence of commands:

window -a Graph;
layer -i %B_Voltage1;
layer -i %B_Voltage2;
layer -i %B_Voltage3;
layer -g;
legend;
layer -a;

I don't know the number of plots which are added as it depends on the number of files which are imported via the script. To have the standard color sequence for the curves I then used:

themeApply2g theme:= "Color List Default" option:=project;

which is ok, because I want the same color sequence for all graphs in the project. Afterwards I ungroup the plots again using:

layer -gu;

so that the user can acces the line plots individually but still has the default list colors.
So far, so good. The colors are ok when I group, change the color, and ungroup the plots within the script window but it does not when I do the same with an external .ogs script. The color list is somehow lost on the way and suddenly all curves are black or red after the ungroup command.
I just copied the commands from the script window into the .ogs file and it looks different. Why? Any suggestions are highly appreciated.

Thanks
Frank

greg

USA
1378 Posts

Posted - 07/01/2010 :  3:05:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is one of those odd cases where timing becomes critical.

I come across these every once in a while and I can't give you an explanation of why this happens, but the datasets are ungrouping before the theme is applied. You stated that this only occurs when running an external OGS while the same code in the Script Window is fine, but I bet if you try the same experiment a few times you may have different results, or one computer may be fine and another fails.

Insert
sec -p .1; // pause for 0.1 seconds
before the
layer -gu;
and everything should be fine.
Go to Top of Page

FS_S

Germany
4 Posts

Posted - 07/02/2010 :  05:13:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Greg,

It really was a timing issue. It just takes over 1 second to change the colors within the six graph windows I use. So when I ungrouped the plots in the script, nothing had really happened, yet.
Thanks for the quick answer.

Frank
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