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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 bin worksheet?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jspector

USA
Posts

Posted - 03/31/2008 :  12:55:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 SR6
Operating System: XP

I have a bunch of worksheets with 3 columns each. I'd like to make a histogram from column 2, go to the bin worksheet, take the ln of the counts column, plot it and fit it to a quadratic, then repeat the process for column 3 of the worksheet, then move on to the next worksheet. I'm having trouble finding information on plotting histograms and accessing their bin worksheets using Origin C, can someone help, or send me to a resource that will... thanks,
-jspector

Iris_Bai

China
Posts

Posted - 04/15/2008 :  05:20:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jspector,

Plot histogram and get Bin worksheet please refer to the following codes:

void show_plot_histogram(int nColIndex = 1)
{
Worksheet wks = Project.ActiveLayer();
if( !wks )
{
MessageBox(NULL, "Please keep worksheet active!", "Error");
return;
}

GraphPage gp;
gp.Create("HIST");
GraphLayer gl = gp.Layers();

Curve cv(wks, nColIndex);
if( gl.AddPlot(cv, IDM_PLOT_HISTOGRAM_TYPE) >= 0)
{
gl.Rescale();
}

get_bin();//get bin data and put into one hidden worksheet
}

void get_bin()
{
string strLTCmd = "get %C -nhwc A; win -o %A {win -h 1;};";
LT_execute(strLTCmd);
}


Iris

Edited by - Iris_Bai on 04/15/2008 05:59:41 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000