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
 Forum for Origin C
 Easy way to change plot style

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
majo0008 Posted - 11/18/2005 : 10:31:23 PM
Is there any way to change the style of multiple plots that are already in a layer without removing the plots and then replotting with a different style? I would like to set up a radio button where the user could select to see the data as scatterplots or lineplots. So far the best I can come up with is to remove the plots and then replot them? Any ideas?

-Ryan

Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System: XP
2   L A T E S T    R E P L I E S    (Newest First)
majo0008 Posted - 11/21/2005 : 12:00:17 PM
Thanks Easwar. The script works great. I got around the issue with the color property resetting by using the OriginC code below:

GraphLayer g1multi = Project. ActiveLayer();

if(plotType == 1) //line plot
{
g1multi.LT_execute("layer -i200 %c");//change to line plot
vector<int> vv = {0}; // 0 is for line color
GroupPlot gPlot1 = g1multi.Groups(0);
gPlot1.Increment.Nester.nVals = vv;

}

if(plotType == 2)//scatterplot
{
g1multi.LT_execute("layer -i201 %c");//change to
vector<int> vv = {4}; // 4 is for symbol EdgeColor
GroupPlot gPlot1 = g1multi.Groups(0);
gPlot1.Increment.Nester.nVals = vv;
}
easwar Posted - 11/20/2005 : 10:42:37 PM
Hi Ryan,

Presume you are working with grouped plots.

When you first create the plot, start with a scatter plot.
Then to switch to line, you can issue the script command:
layer -i200 %c; legend;

To switch back to scatter, you can issue the script command:
layer -i201 %c; legend;

You could then alternately issue the above two commands depending on what user selects using the radio buttons. I suggest starting with scatter because otherwise the group color property seems to get reset and scatter becomes all black.

Easwar
OriginLab



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