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
 Two contour plots from two Matrix on one Graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

redspirit

Germany
45 Posts

Posted - 07/17/2013 :  6:36:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0 SR2
Operating System: Windows7 64 bit
Hallo everybody,
I have two matrix with data and want to plot two contour plots the same style on one Graph. First, I create a contourplot from the first matrix, then add a new layer:

worksheet -p 226 contour;
layer -n; // create second new layer
layer -i Matrix2; // add Matrix2 to second layer
speedmode sm:=off;

then I apply a theme and layer size/position, using same script. For the first Layer all OK, for the second-not, the problem with the Axis Title appear-command error on the part, marked red in the list below. Why??? The script is the same for both graph. By the way, if I open manually axis properties by double click and then check and unchek the "Show Axis & Ticks", then red part of the script works and Axis Titles appear!!! Bug?:


page.active = 1;
themeApply2g theme:= "ADAM_factor2" option:=page;

layer.unit=3;
layer.width=10; layer.top=2;
layer.height=10; layer.left=2;
layer.factor=1;

layer.x.from = 0;
layer.x.to = 25;
layer.x.inc = 5;
layer.y.from = 0;
layer.y.to = 25;
layer.y.inc = 5;

XB.text$=" \g(a)\-(i)";
YL.text$=" \g(a)\-(f)"; // works fine for the first Graph

label -a 1.5 19 -b 2 \p100(\b(\i(R++)));

// now the same for the second graph

page.active = 2;
themeApply2g theme:= "ADAM_factor2" option:=page;

layer.unit=3;
layer.width=10; layer.top=2;
layer.height=10; layer.left=16;
layer.factor=1;

layer.x.from = 0;
layer.x.to = 25;
layer.x.inc = 5;
layer.y.from = 0;
layer.y.to = 25;
layer.y.inc = 5;

until here is fine,two graph with the same size and scale, then:

XB.text$=" \g(a)\-(i)";
YL.text$=" \g(a)\-(f)";
#Command Error!


Why???


Kathy_Wang

China
159 Posts

Posted - 07/18/2013 :  01:36:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

When you use the command "layer -n" to add a new layer, the axis title objects XB and YL will not be created automatically, that is why you encounter "command error" for the second layer. But when you are making change in the axis dialog, the operation will then create the XB and YL objects in this layer, and then you are able to use these objects.

So a suggestion is that instead of using "layer -n" command, use the layadd x-function to add a new layer. Then the XB and YL objects will be automatically created in the new layer so that your script should then work fine.

For example, you can then modify the first part of your script as following:


worksheet -p 226 contour;
layadd userdef:=1 linkto:=0 xaxis:=none yaxis:=none; // create second new layer with no axis linking
layer -i Matrix2; // add Matrix2 to second layer
speedmode sm:=off; 


Kathy
Originlab
Go to Top of Page

redspirit

Germany
45 Posts

Posted - 07/18/2013 :  04:48:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you, Kathy,
but now I got a problem with the switching off the speed mode. The script is:



worksheet -p 226 contour;
layadd userdef:=1 linkto:=0 xaxis:=none yaxis:=none; // create second new layer with no axis linking
layer -i M372ddNormRea; // add Matrix2 to second layer

page.active = 1;
themeApply2g theme:= "ADAM_factor2" option:=page;

layer.unit=3;
layer.width=10; layer.top=2;
layer.height=10; layer.left=2;
layer.factor=1;

layer.x.from = 0;
layer.x.to = 25;
layer.x.inc = 5;
layer.y.from = 0;
layer.y.to = 25;
layer.y.inc = 5;

XB.text$=" \g(a)\-(i)";
YL.text$=" \g(a)\-(f)";

label -a 1.5 19 -b 2 \p100(\b(\i(R++)));


page.active = 2;
themeApply2g theme:= "ADAM_factor2" option:=page;

layer.unit=3;
layer.width=10; layer.top=2;
layer.height=10; layer.left=16;
layer.factor=1;

layer.x.from = 0;
layer.x.to = 25;
layer.x.inc = 5;
layer.y.from = 0;
layer.y.to = 25;
layer.y.inc = 5;

XB.text$=" \g(a)\-(i)";
YL.text$=" \g(a)\-(f)";

label -a 1.5 19 -b 2 \p100(\b(\i(R--)));

speedmode index:=folder sm:=off;


but the second graph remains with speed mode on. If I just repeat in command window ones again
speedmode index:=folder sm:=off;

then speed mode goes off. Why Origin ignore speedmode in script? (I think, that before I updated Origin with SR1 and SR2 it was fine)
Go to Top of Page

Kathy_Wang

China
159 Posts

Posted - 07/19/2013 :  01:44:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

This seems to be a bug introduced in 9.0 SR1, we will try to fix it as soon as possible. Sorry for the inconvenience.

For now there are two workaround to turn off speed mode for all layers successfully:

1) add "layer -a" command to rescale the new layer, so that part of your script can be modified as:

worksheet -p 226 contour;
layadd userdef:=1 linkto:=0 xaxis:=none yaxis:=none; 
layer -i M372ddNormRea; // add another matrix to second layer
layer -a;


2) use the "sec -p" command to pause the executing of the "speedmode" x-function, so that part of your script can be modified as:


label -a 1.5 19 -b 2 \p100(\b(\i(R--)));
sec -p 1;//pause for 1s before executing the next line
/*Note that the pause time may need to be longer if you have bigger matrix data*/
speedmode index:=folder sm:=off; 


Hope this information helps!

Kathy
OriginLab

Edited by - Kathy_Wang on 07/19/2013 01:45:20 AM
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