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
 Origin Forum
 Simple Histogram Question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

O-2

5 Posts

Posted - 05/02/2014 :  02:09:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a very simple data set consisting of two columns of integers.

I would like to produce a histogram of Column B across the range of Column A. i.e. bin up the numbers in column B for each corresponding value of A.

For example, if I have the data set: -

A B
0 1
1 1
2 3
1 0
3 2
1 2
2 2

I would like to plot B vs A, but binning each value of B, so what would actually be plotted is: -

A B
0 1
1 3
2 5
3 2

There must be an automated histogram tool that does this.

I'm sorry for the simple question.

lkb0221

China
497 Posts

Posted - 05/02/2014 :  10:15:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can use Analysis: Data Manipulation: Reduce Duplicate X Data tool


Zheng
OriginLab

Edited by - lkb0221 on 05/02/2014 10:38:45 AM
Go to Top of Page

Drbobshepherd

USA
Posts

Posted - 05/02/2014 :  12:18:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
O-2,

Zheng's suggestion to use the Reduce Duplicate X Data tool is simple and straight-forward, but I liked his 1st suggestion (which I believe he retracted) to use a pivot table, because it is potentially more powerful. If you anticipate having more than one set of (A,B) values, the pivot table may be the better way to calculate your histograms.
.
For example, you could calculate sums according to the month the (A,B) value was collected. Simply add a third column to your data, enter the month for each data point, and use the Worksheet:Pivot Table tool to calculate your sums. This works even if you don't need to group your data (Just enter the same month for all points).

DrBob
Go to Top of Page

Drbobshepherd

USA
Posts

Posted - 05/02/2014 :  12:42:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
O-2,

CLARIFICATION:

When I wrote,
quote:
one set of (A,B) values

I meant "one complete group of A-B data", not "one (A,B) data point". For example, the data you presented in your post would be one group of A-B data; then next month, you may have another set of A-B data.

DrBob
Go to Top of Page

lkb0221

China
497 Posts

Posted - 05/02/2014 :  1:54:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Since DrBob mentioned, I re-post the pivot table method here in case someone is interested.

Edited by - lkb0221 on 05/02/2014 1:54:29 PM
Go to Top of Page

O-2

5 Posts

Posted - 05/03/2014 :  03:52:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you all, the pivot table solution worked very well.
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