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
 set shape/filling based on column values

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
rapt1 Posted - 03/29/2021 : 3:20:46 PM
Hi,

I want to set the filling and the shape of symbols in a scatter plot based on values in a column like it works in the gui (custom construction -> by Column) see also that question:
https://my.originlab.com/forum/topic.asp?TOPIC_ID=46692
How to do it in origin C?

Do I follow the same approach for SetSymbol? I would need to replace the "color function" I guess, any hint?

Best,
D


win10
OriginPro 2021 (64-bit)
9.8.0.200

2   L A T E S T    R E P L I E S    (Newest First)
rapt1 Posted - 04/02/2021 : 11:58:35 AM
Thank you.

win10
OriginPro 2021 (64-bit)
9.8.0.200
cpyang Posted - 03/31/2021 : 8:35:14 PM
We are adding this general support, so you need our next beta or wait for 2021b release. Our next beta is likely to be available by the end of this week and it is called Beta9.

Here is the code and the worksheet

void size_and fill_from_col()
{
	Worksheet wks = Project.ActiveLayer();  // get worksheet with group.dat data	
	DataRange dr;
	dr.Add(wks, 0, "X");
	dr.Add(wks, 1, "Y");
	
	GraphPage gp;
	gp.Create("scatter");  // create scatter graph	
	GraphLayer gl = gp.Layers(0);
	int nPlot = gl.AddPlot(dr, IDM_PLOT_SCATTER);  // add plot to layer
	gl.Rescale();

	DataPlot dp = gl.DataPlots(nPlot);
	dp.SetProp("symbol.kind", 2);//circle
	//from 1 col on the right of Y, col(C)
	double vv;LT_evaluate("modifier(1)",&vv);
	int nModi = (int)vv;
	dp.SetProp("symbol.size", nModi);//size 
	dp.SetProp("symbol.SizeFactor", 30);
	//from 2 col on the right of Y, col(D)
	LT_evaluate("modifier(2)",&vv);
	nModi = (int)vv;
	dp.SetProp("symbol.interior", nModi);//1=close, 2=open
}





To find the LT property for data plot, from script window:

layer.plot.=;
layer.plot.symbol.=


CP

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