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
 How to set plot symbol = curve number
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tom3m

USA
27 Posts

Posted - 05/30/2002 :  1:11:46 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a macro that plots pairs of columns and wish to change the symbol types for each curve to be the curve number. For example, if I add plots from worksheet JvsV to a layer as in the following:

loop(ii, 1, ipasses){
lay -i202 %(JvsV, 2*ii);};

In this case voltage columns are V1, V2, ..., and current density columns are J1, J2, ... I would like to also change the plot symbol to be equal to the number ii. I can change to color number ii with no problem using

set JvsV_J$(ii) -cl ii;

and tried using

set BvsV_J$(ii) -k 11;

but this sets the symbols to equal the data point number (symbol for first data point is 1, second data point is 2, ..., Nth data point is N). I figured out how to manually set the symbol to a given character using the plot properties, but I want to do this in a script. Is there a labtalk command to set the symbol for each plot to be the curve number?

Mike Buess

USA
3037 Posts

Posted - 05/30/2002 :  4:42:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Your last expression should work unless the set command is interpreting the dataset name incorrectly. You might try this variation for kicks...

%A=BvsV_J$(ii);
set %A -k ii;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 05/30/2002 16:44:31
Go to Top of Page

tom3m

USA
27 Posts

Posted - 05/31/2002 :  08:36:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That doesn't work. If I use

%A = JvsV_J$(ii);

and then

set %A -k 11;

each curve has symbols 1,2,3,4,5,etc. If I use

set %A -k 12;

each curve has symbols A,B,C,D, (A for data point 1 in the column, B for data point 2 in the column, ...) etc., and if I use

set %A -k 13;

then each curve has symbols a,b,c,d,...

I can use the lower numbers and variations like

set %A -k 1;

to get square symbols. I can also manually set the curve symbol to be a fixed number using the plot details box, but I am writing a macro that plots something like curve tracer data, and there are many curves for one measurement (and multiple measurements to look at - not on the same plot - too messy).
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 05/31/2002 :  11:29:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
So you want a to label each point in a curve with the curve number? You've found the ways to get incremental numbers and letters, but it appears the it is only possible to get individual alpha or numeric symbols for each dataset is through the Plot/Details Dialog.

Alternately you could try:

A) Creating BMP graphics of 24 letters/numbers and using these.

B) Use "set DatasetName -k value", where value = 100 + number-of-columns-to-the-right. For example, to base the symbol shape on a dataset located two columns to the right of the data plot's Y dataset in the worksheet, use value = 102. (Note: There is a limit of four columns to the right.)

I don't think this would be a tough thing for Origin to add to the labtalk set -k shape# command since there is lots of room between 20 and 56. I'm sure I would find this feature worthwhile.

Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring
Go to Top of Page

tom3m

USA
27 Posts

Posted - 05/31/2002 :  2:20:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Either that, or they could just use something like a "-kn char#" switch to the set command that uses the character number in the set of characters in the Plot/Details dialog. Then there are lots of characters to choose from, and I might use letters for curve numbers >= 10. What I really want is a plot label that is the curve number, though, and that would require a string instead of just a single character.

I tried the 100 plus number of columns to the right method. As far as I can tell, the entries in the column to the right have to be indices into the allowed symbol type numbers used for the "set DataSet -k value" command (value=1 for square, 2 for circle, etc.).

Thanks for all the help. I don't really want to deal with bitmaps, so I think for now I will just use symbols and a legend to decode curve number.
Go to Top of Page

Laurie

USA
404 Posts

Posted - 06/03/2002 :  2:25:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What about using Plot Details to set the symbol to 1 and then making sure the datasets are grouped so that they increment. This would only be good up to 9 datasets per layer. You could then save the template.

OriginLab Technical Support
Go to Top of Page

tom3m

USA
27 Posts

Posted - 06/05/2002 :  11:32:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That is a good idea, but we are plotting 20 traces at a time. After some discussions with various users of the macro in my group, we came up with a way to visualize the data in bands coded first by color and then by symbol type. It turns out visualizing by bands of color provides a better idea of what happens during the experiment than plotting curve trace number.

Cheers!
Go to Top of Page

rdremov

USA
28 Posts

Posted - 06/12/2002 :  5:06:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
you can easily acomplish this with:
SET %C -ka 49; // 48 + nCurve
labtalk script

Thanks,
Roman.
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 06/13/2002 :  11:18:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Roman,

That works! It's a nice undocumented trick. Anyway to avoid the connecting lines?

Craig



Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring
Go to Top of Page

tom3m

USA
27 Posts

Posted - 06/18/2002 :  3:12:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It seems Roman's method only works for values of ncurve up to 9. After that you get other symbols (not numbers). It is great to know how to do this, though.

Thank you for the help!
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