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
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.
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; }