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
 Use data from input file in legend (very basic)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hetanquary

USA
7 Posts

Posted - 10/10/2011 :  7:03:55 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 8.1 SR1 v8.1.13.88 (Academic)
Operating System: Windows XP

I need to create a legend on my graph using text from top of my input ascii file. I have been reading and learning about how the headers and subheaders and all that work and I understand how the default legend works I believe but I need the legend to have 4 separate lines instead of one long line. The first 4 lines of the input file should be the legend. Can I do this using the default legend somehow, or do I need a script? As you can tell I am very new to this. Any help would be appreciated.

greg

USA
1378 Posts

Posted - 10/11/2011 :  12:13:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use the Insert Variables dialog to add import header variables to any text object (and there is nothing special about the legend text object except its name).

Double-click on the text of an existing legend and position the cursor where you want variables added, then press Ctrl+H to open Insert Variables. You can choose to insert variables as links (showing just values) or as equations : VariableName = Value.
The former values update based on contents in the worksheet, while the latter is static text.

When you edit a legend in this manner, you should no longer use Graph : New Legend as that will wipe out your changes. Use Graph : Update Legend to protect your added text.


Go to Top of Page

hetanquary

USA
7 Posts

Posted - 10/11/2011 :  12:51:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you, that is very helpful! I was able to modify the legend the way I wanted it. Now I need to make it grab that data and create the legend in that format every time I import a new ascii. Is that what the themes are for? Or is it part of the template or the project?
Go to Top of Page

greg

USA
1378 Posts

Posted - 10/11/2011 :  1:54:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
An Import Filter can be used to make sure you grab all the header variables you need. If you create a graph of the imported data and setup the legend to use Links, then you can save the graph as a Template and use it to plot data from all such imported data and the legend will grab the correct information from the worksheet.
Go to Top of Page

hetanquary

USA
7 Posts

Posted - 10/11/2011 :  2:52:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for all your help. There are some things I am not really understanding though because I can't get things to work out the way I want. May be it would help if I describe my project a little. Right now my setup is like this: I have created two templates because my data produces to graphs. I saved the templates with all their settings into a project. In the project I use a worksheet script to plot the data in the correct way. My procedure is to open the project, then import the data using import single ascii. I have set up the import so that the first 4 lines of the input file get read into the comment line. Right now, the graph is not doing anything with those first four lines. I would like it to put those first four lines into the legend.

After opening my project, importing the data (which produces the 2 graphs) I did what you suggested (double clicked the legend, hit ctrl-h, chose insert as link and selected SubHeader). This produced the correct result. I did the same thing on the second graph. I then right clicked the legend, selected save format as theme, named and saved it. I also resaved both the templates after I got the legend how I wanted it. Obviously this was not all I needed to do, or I have done something wrong in the previous steps because when I import some new data, the new legend is not generated, it is blank.

Sorry for the lengthy post. I hope it makes sense.

Edited by - hetanquary on 10/11/2011 2:55:02 PM
Go to Top of Page

hetanquary

USA
7 Posts

Posted - 10/12/2011 :  11:30:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
So after that incredibly long post I actually think I have figured it out now. Thank you for all you trouble!
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