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
 Using worksheet name as graph name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Viswanath14

India
6 Posts

Posted - 05/16/2015 :  09:38:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I'm trying to create a graph with line plot of the data taken from worksheet. I have a large number of worksheets and the same procedure will be repeated over all of them to create a corresponding graph for each one of the worksheets. Is it possible to name the graph automatically with the corresponding worksheet name instead of names like 'Graph 10', 'Graph 11'?

Thank you,
Viswanath.

Origin Ver. and Service Release (Select Help-->About Origin):
OriginPro 9.0.0 (64-bit) SR2
Operating System: Windows 8.1

Edited by - Viswanath14 on 05/16/2015 09:40:17 AM

jasonzhao

China
262 Posts

Posted - 05/17/2015 :  10:49:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Please try the script below:


// change the name of the graph window into new name.
i=1;
doc -e p {
win -r %H "SheetName$(i)";
i++;
}

Also refer to this link for help:
http://www.originlab.com/doc/LabTalk/ref/Window-cmd#-r.3B_Rename_windowName_with_the_given_newName

Best regards!
Jason
OriginLab Technical Service



Edited by - jasonzhao on 05/17/2015 10:50:16 PM
Go to Top of Page

vancity

USA
4 Posts

Posted - 02/03/2016 :  1:55:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It did not work well. As the "graph1" becomes to "sheetname1".

If graph1 is coming from Workbook "W345" and graph2 is coming frang workbook "C435", how can the script loop all the graph window and change with the name of workbook associated with the graph?

I tried this but did not work either

doc -e p
{
page.active=1;

page.label$=%(1Y,@WS);
;

}





quote:
Originally posted by jasonzhao

Hello,

Please try the script below:


// change the name of the graph window into new name.
i=1;
doc -e p {
win -r %H "SheetName$(i)";
i++;
}

Also refer to this link for help:
http://www.originlab.com/doc/LabTalk/ref/Window-cmd#-r.3B_Rename_windowName_with_the_given_newName

Best regards!
Jason
OriginLab Technical Service




Go to Top of Page

snowli

USA
1381 Posts

Posted - 02/03/2016 :  2:36:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just FYI: Origin 2016 supports set graph short name or long name to be book/sheet/column name, etc.

Here is a video for this:
http://originlab.com/index.aspx?go=support/videotutorials&pid=3190

See release notes about this: https://originlab.jira.com/wiki/x/ZIDnAw


When save graph template, preset graph short name or long name. Then when using it to plot new data, graph name will be preset.

Or after plotting one graph, when doing batch plotting of other data, you can set the graph short name or long name.


Thanks, Snow
Go to Top of Page

vancity

USA
4 Posts

Posted - 02/04/2016 :  4:17:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
For graphs already existed, the new feature wont work.


quote:
Originally posted by snowli

Just FYI: Origin 2016 supports set graph short name or long name to be book/sheet/column name, etc.

Here is a video for this:
http://originlab.com/index.aspx?go=support/videotutorials&pid=3190

See release notes about this: https://originlab.jira.com/wiki/x/ZIDnAw


When save graph template, preset graph short name or long name. Then when using it to plot new data, graph name will be preset.

Or after plotting one graph, when doing batch plotting of other data, you can set the graph short name or long name.


Thanks, Snow

Go to Top of Page

lkb0221

China
497 Posts

Posted - 02/04/2016 :  4:49:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
doc -e p {
range -wy rr1 = 1; // Y of first plot in layer
range rr2 = rr1.GetLayer()$;
win -r %H %(rr2.Name$);
}
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