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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 plotting data for a limited range of rows

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Dougkeil Posted - 08/19/2004 : 7:02:11 PM
I want to write a script that automatically plots only a specified range of rows in a worksheet. If I use the following code in my script (where Radial_Jsat is a plot template):

window -t plot Radial_Jsat ; //make graph from template;
Layer -i Labdata_Jsat ; // plot data

what I get is a plot that uses the Radial_Jsat template to plot the ENTIRE range of rows in the worksheet column Labdata_Jsat.

How do I just plot a specified range of rows in the column Labdata_Jsat ranther than the entire column?
8   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 08/24/2004 : 09:10:35 AM
2) If you are creating the file list yourself it might be enough to add a dummy column filled with (for example) zeros...

filename1 0
filename2 0
filename3 0
[etc]

Import ASCII should handle a file like that.

Mike Buess
Origin WebRing Member
Laurie Posted - 08/23/2004 : 3:56:38 PM
A legend is a unique text label. Origin names the text label "Legend" to identify it. This name is stored in the legend's Label Control dialog box. You can open this dialog box by selecting the legend and then selecting Format:Label Control. If you rename the legend, it will maintain its current contents but it will no longer update when you click New Legend or when you add data to the layer.

A legend text label uses special formatting to display the data set names and the data plot type icon (such as a line).

The %(1) is called substitution notation. This notation instructs Origin to display the data set name for the first data set in this layer.

In addition to substitution notation, Origin uses a special escape sequence to display the data plot icon in the legend (such as a line). This special escape sequence is:

\L(DataListPosition)

Where DataListPosition is the data plot's position in the data list, the list of plotted data at the bottom of the Data menu.


OriginLab Technical Support
Mike Buess Posted - 08/23/2004 : 07:58:21 AM
1) CP's suggestion is by far the easiest but you can also use something like this...

loop (ii,1,page.nlayers) {
if(ii==1) %L=Layer 1;
else %L=%L\nLayer $(ii);
lay -o ii {
%Z=""; lay -c;
loop (jj,1,count) {
%L=%L\n\l($(ii).$(jj)) %($(ii).$(jj));
};
};
};
label -s -sa -n legend %L;

2) This may or may not be useful but you can open the file in the script window with this...

%Z="file path\name";
type -o open %Z;

Then copy/paste to a worksheet column if you like.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/23/2004 08:02:46 AM
cpyang Posted - 08/22/2004 : 10:11:43 PM
quote:
All attempts at importing such a file give me a "file contains no data" error message.


Reading ascii files from LabTalk has no control on things of that nature. Origin assumes that the ASCII files has at least one column with numeric data. In order to control the ASCII import, you will have to use Origin C.

quote:
Thanks for the response but I forgot to explain that I am not interested in being able to do this interactively but in a script


What Mike was suggesting was probably that you should use a template. You create the needed graph interactively, then save the template, and your script just load in the template and add the needed data into this template. The templates should remember everything, so the code to make the graph will be very simple. All the details about the graphs are constructed graphically (interactively) so much more details can be put into the template then can be typically done by codes.

CP


Dougkeil Posted - 08/22/2004 : 8:43:24 PM
Thanks for the response but I forgot to explain that I am not interested in being able to do this interactively but in a script. What is does the labtalk script look like to be able to do the same thing you described. What script commands, object variables, etc., should be used to effect these changes.

As for the question about the ASCII text, what I have is an ASCII text file which is a list of file names. I want to read this file into orgin as a collumn of text file names in a worksheet. How do I do this? All attempts at importing such a file give me a "file contains no data" error message.
Mike Buess Posted - 08/21/2004 : 07:15:43 AM
1) Format->Page, Legends tab. Check "Include dataplots from all layers". OK and then Graph->New Legend. The text beside the symbol is taken from the column label (if any) so you could use that for a layer description.

2) Is there a header? What is the column separator? How many columns? Give us a few details, please. How about posting a few lines of a sample file?

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/21/2004 07:28:05 AM
Dougkeil Posted - 08/20/2004 : 7:42:00 PM
Thanks for the response. Now I have another few questions.

1) I want to create a plot of several layers. When I am done I want to create a legend that shows the symbols used for the plot in each layer. Next to the symbol displayed in the legend I would then like to place some descriptive text which I can specify as needed for each layer. How do I do this?

2) When I try to use the ASCII inport to import a file containing text it seems that no matter what import settings I use I cannot read in the file. How do I read in a list of ASCII text?
Mike Buess Posted - 08/19/2004 : 8:50:34 PM
window -t plot Radial_Jsat ;
Layer -i Labdata_Jsat ;
set Labdata_Jsat -b 1stRow;
set Labdata_Jsat -e lastRow;
lay -a;

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000