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
 LabTalk Forum
 histogram
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rtsen

Canada
5 Posts

Posted - 04/15/2003 :  4:32:54 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
how would I plot a dataset as a histogram. I am currently using the column plot but I can't adjust the bin size afterwards with labtalk.

for example:

wks.addCol(temp);
data1_temp1=histogram(Data1_a,1,0,200);
win -t Plot column;
label -xb "intensity";
label -yl "counts";
layer -i Data1_temp1;
Rescale;

but then I can't change the bin values with the following code:

get %C -hbb MIN;
get %C -hbe MAX;
get %C -hbs BIN;
getn Minimum min Maximum max Step bin (Re-bin Histogram);
set %C -hbb min;
set %C -hbe max;
set %C -hbs bin;
layer -a;

Laurie

USA
404 Posts

Posted - 04/21/2003 :  10:28:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The histogram plot type is different from the column plot type. Use the following:

win -t Plot hist; //create from histogram template
layer -i Data1_temp1; //add data to layer
layer -a; //rescale axes

When Origin creates a histogram by selecting Plot:Statistical Graphs:Histogram, it also runs this code:

get %C -nhwc A; //Create the frequency worksheet associated with the histogram.
win -o %A {win -h 1;}; //hides this freq. wks

OriginLab Technical Support
Go to Top of Page

rtsen

Canada
5 Posts

Posted - 04/24/2003 :  12:18:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks for the reply,

I was wondering when you plot the histogram using:

win -t Plot hist; //create from histogram template
layer -i Data1_temp1; //add data to layer
layer -a; //rescale axes

is there a way to scale the x-axis to start at the min and end at the max which is determined by the range of the dataset.


Also when you use the following commands to get the frequency to show in a new worksheet:

get %C -nhwc A;
win -o %A {win -h 1;};

and when you change the bin of the histogram graph with:

get %C -hbb MIN;
get %C -hbe MAX;
get %C -hbs BIN;
getn Minimum min Maximum max Step bin
set %C -hbb min;
set %C -hbe max;
set %C -hbs bin;
layer -a;

can you automatically change the bin size on the new worksheet you created before to show the updated values.

thank you in advance
Go to Top of Page

Laurie

USA
404 Posts

Posted - 04/25/2003 :  09:46:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use the limit command. The limit command operates on a Y dataset but will return the xmin and xmax for the corresponding X dataset.

limit data1_temp1;
limit.xmin=;
limit.xmax=;

You can then use the following (when the graph window is active):
layer.x.from=limit.xmin;
layer.x.to=limit.xmax;

When you use the following 3 commands:
set %C -hbb min;
set %C -hbe max;
set %C -hbs bin;

The hidden Bin1 worksheet automatically updates. Is this not happening?

OriginLab Technical Support
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