| T O P I C R E V I E W |
| cheyenne |
Posted - 02/19/2005 : 05:21:35 AM Origin Version (Select Help-->About Origin): 7.5 Operating System: XP
Dear friends of the forum, here it comes a question I hope not difficult to answer for some of you. Let's assume i have two folumns set as XY and a third one set as categorical. What I'm trying to do is plotting the XY dataset in as many layers as the differet values in the categorical dataset, and, at the same time color mapping every single curve in every single layer to the respective categorical value. For example: let us assume X is Temperature, Y Resistivity and Applied Magnetic Field is the third column set as categorical, and it has the 4 values 1,2,3 and 4. I would like to plot then the for Resistivity curves related to the 4 magnetic field values in the same graph but in 4 different layers, corresponding to the Field values, each curve color mapped to the related Magnetic field value as well. I spent almost two days searching the on line labtalk guide, but i had to give uo in the end...I still believe the labtalk guide has almost everything...but for beginners the infos are far too fragmented to be considered effective. |
| 4 L A T E S T R E P L I E S (Newest First) |
| cheyenne |
Posted - 02/23/2005 : 09:40:40 AM Thank you Mike, I have to admit that you always manage to rescue me somehow, sorry for not thanking you before but I was away. This script looks much better than mine actually, I tried something similar but it didn't work so far...I'll let you know whether your script achieves what mine didn't...for the time being...thank you very much once again. |
| Mike Buess |
Posted - 02/20/2005 : 09:20:41 AM The tool is based on OriginC code which can be modified for your purposes. For more possibilities see this forum topic...
http://www.originlab.com/forum/topic.asp?TOPIC_ID=3668
...Here's the brute force LabTalk solution. The initial sort will not be necessary if your worksheet is already grouped by the col 3 values.
%W=%H; sort -w %W col(3); // arrange wks in blocks win -d; // duplicate wks doc -e W {%A=%H}; // find name of new wks; %A!page.label$=1; // label with block index %A!page.title=3; // show label kk1=list(2,%(%A,3)); // beginning of block 2 kk1--; // end of block 1 set %A -er kk1; // size wks to block 1 win -a %W; // activate original wks win -d; // duplicate doc -e W {%A=%H}; // find new name mark -d %(%A,1) -b 1 -e kk1; // delete block 1 %A!page.label$=2; // label with block index %A!page.title=3; kk2=list(3,%(%A,3)); // beginning of block 3 kk2--; // end of block 2 set %A -er kk2; // size wks win -a %W; win -d; doc -e W {%A=%H}; kk1+=kk2; // # of rows in blocks 1 and 2 mark -d %(%A,1) -b 1 -e kk1; // delete blocks 1 and 2 %A!page.label$=3; // label with block index %A!page.title=3; kk2=list(4,%(%A,3)); // beginning of block 4 kk2--; // end of block 3 set %A -er kk2; // size wks win -a %W; win -d; doc -e W {%A=%H}; kk1+=kk2; // number of rows in blocks 1, 2 and 3 mark -d %(%A,1) -b 1 -e kk1; // delete blocks 1, 2 and 3 %A!page.label$=4; // label with block index %A!page.title=3;
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 02/20/2005 11:43:03 AM |
| cheyenne |
Posted - 02/20/2005 : 09:08:45 AM Thanks CP, I'm sure that the tool you suggested can be very useful, but unfortunately is not what I'm looking for, as a matter of fact I need a labtalk script because the whole process has to be automated...I'm dealing with tens of columns...
Thank you very much anyway, I still couldn't find the solution to my problem...damn it!
|
| cpyang |
Posted - 02/19/2005 : 09:41:25 AM This can be easily done using Origin C, but not sure if LabTalk can do this.
But how using the following tool to create separate worksheet?
http://www.originlab.com/FileExchange/index.aspx?C=5&cid=23
this will extract the data into 4 worksheets and then you can make the plots, then merge them together.
CP
|
|
|