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
 Change incremental line color inc. line 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
HTNicolai Posted - 05/24/2005 : 06:44:16 AM
Origin Version (Select Help-->About Origin): 7.0383
Operating System: Win XP

Hello,

I'm trying to make a Origin C script that changes a graph with colored plots into a graph with black plots (with different styles) and vice versa.
There is a handy option in Origin itself. You can access it by right-clicking a graph, choosing "Plot Details" and then select a group of plots. When the Edit-mode is set to "Dependent", you can select either "incremental color" and/or "incremental style".

Is there a way to access this setting in Origin C? Or do I have to make a script which changes the color of all the lines one by one?

Thank you!
2   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 05/25/2005 : 6:05:32 PM
I have created the following example to help illustrate

 

void set_group_plot_increment_by(BOOL bColor, BOOL bShape, BOOL bSymbolInterior, int nGroupIndex = 0)
{
GraphLayer gl = Project.ActiveLayer();

if( !gl )
return;

// get group plot by index from the active layer
GroupPlot gPlot = gl.Groups(nGroupIndex);

if( !gPlot )
return;

vector<int> vv;
if(bShape)
vv.Add(3); // 3 is for symbol shape
if(bColor)
vv.Add(0); // 0 for line color, which is also symbol color
if(bSymbolInterior)
vv.Add(8); // 8 for symbol interior

gPlot.Increment.Nested.nVal = 0; // not to be nested, as that will be more complicated
gPlot.Increment.Nester.nVals = vv;
}





CP


rdremov Posted - 05/25/2005 : 5:14:15 PM
This feauture is only available in Origin 7.5 as part of new Theme Object Property Access mechanism:


#include <Origin.h>

void example_incrementor_access(int nGroupPlotIndex = 0)
{
// active graphic layer
GraphLayer gl = Project.ActiveLayer();

if( !gl )
return;

// get group plot by index from the active layer
GroupPlot gPlot = gl.Groups(nGroupPlotIndex);

if( !gPlot )
return;

// just for debugging purpose to show what is inside
TreeNode tr = gPlot.Increment;
out_tree(tr);

//////////////////////////////////////////////////////////////
// nester is array of integers
// order is only used if Nested =1
// if not nested, then index of array is not important
// values of the nester array can be any of the following:
// 0 - COLOR
// 1 - BKCOLOR
// 2 - STYLE
// 3 - SHAPE
// 4 - EDGECOLOR
// 5 - FILLCOLOR
// 6 - PATTERN
// 7 - PATTERNCOLOR
// 8 - INTERIOR
// 9 - CHARACTER
// if some value is present, it means it will be incremented
// according to corresponding increment list

// nest only shape
vector<int> vv = {3}; // see above, 3 is for shape

// this line does it all
gPlot.Increment.Nester.nVals = vv;
}


Edited by - rdremov on 05/25/2005 5:17:24 PM

Edited by - rdremov on 05/25/2005 5:18:30 PM

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