T O P I C R E V I E W |
bafaneh |
Posted - 10/07/2011 : 4:18:53 PM Origin Ver. and Service Release (Select Help-->About Origin): 8.5 Operating System: w7
Hi,
I have a column, y_center plotted versus theta_offset, and y_center has negative values until a certain point, and then has only positive values.
I want to create a new column y_folded which I will then program to have plotted, which is abs(y_center) which I know how to do. However, I also want to start a new series in the same plot as soon as the data that I am taking the absolute value of changes from negative to positive, thus folding the y_center data.
Is there any easy way to have a new series start in one's plot when the values of the data I'm plotting turns positive? I think the easiest way is to use a loop, but I need help on the details.
Thanks, Basheer |
4 L A T E S T R E P L I E S (Newest First) |
bafaneh |
Posted - 10/17/2011 : 5:55:33 PM Hi Greg,
I was changing the color of the two data ranges in one of the graphs in my plotpanel which is 8 by 3. It has 24 layers, and so I set range rap1= 24 and rap2 = 25 and that didn't work. I tried making rap1 = [Graph name]24!1 and rap2 = [Graph name]24!2, but that didn't work either. However, when I was trying to change one of the middle graphs just to see how it worked, I ended up setting rap1= 5 and rap2 = 6 and it magically made the correct graph's data ranges change colors.
Could you explain this?
-Basheer |
bafaneh |
Posted - 10/10/2011 : 2:53:40 PM Thank you very much for your response. |
greg |
Posted - 10/10/2011 : 2:43:55 PM Not sure what the win -a %(pageName$); is for.
As soon as you create your first plot: plotxy iy:=(33,30)[1:positive] plot:=202 ogl:=1; the worksheet is not longer active, so the range notation (33,30) will no longer work.
Also, I am not sure what your intention is by using [Graph26] in the second plot command. As written, that plot will go to a window named Graph26 which is not the same window as the first plot.
Here is some code that pre-declares the plot ranges, plots the first to a new window, then adds the second to that window with a different color:
// Assuming worksheet is active range rneg = (33,30)[1:positive]; range rpos = (33,30)[positive:25]; plotxy iy:=rneg plot:=202; // ogl:=1 is the same as new graph plotxy iy:=rpos plot:=202 ogl:=1; // same graph layer as above range rap1 = 1; // Point to first plotted range range rap2 = 2; // Point to second plotted range set rap1 -c 2; // Set the negatives to red set rap2 -c 4; // Set the positives to blue
|
bafaneh |
Posted - 10/07/2011 : 5:21:39 PM This is what I have so far (It is outputtign #Command error!):
//y_folded for(ii=1; ii<=25; ii++) { if(col(30)[ii] > 0) break; positive=ii; }; win -a %(pageName$); plotxy iy:=(33,30)[1:positive] plot:=202 ogl:=1; plotxy iy:=(33,30)[positive:25] plot:=202 ogl:=[Graph26]; |
|
|