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
 Histogram with weight
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

spirittoto

3 Posts

Posted - 06/27/2013 :  12:18:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.9:
Operating System: 64 win7

Hi all,

I have two columns of data, one is normal data and another one is the number of repetitions of the first data. How to plot a histogram by considering the second column of data?

Thank you in advance!

Edited by - spirittoto on 06/27/2013 12:30:57 PM

meili_yang

103 Posts

Posted - 06/27/2013 :  5:06:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I think there is not a direct way to plot like that. You might try to use some scripts to generate a new column, then plot histogram from there.

Regards,


quote:
Originally posted by spirittoto

Origin Ver.9:
Operating System: 64 win7

Hi all,

I have two columns of data, one is normal data and another one is the number of repetitions of the first data. How to plot a histogram by considering the second column of data?

Thank you in advance!



Meili
OriginLab Tech Support
Go to Top of Page

meili_yang

103 Posts

Posted - 06/27/2013 :  5:39:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

My colleague wrote the following script for you.
Assume the column 1 is normal data, and column 2 is repetition number. You can try the following script:

int m = wks.maxRows;
int r1 = 1;
int r2 = 1;
Loop(ii,1,m)
{
int t = cell(ii,2);
double x = cell(ii,1);

r2 += t;
Loop(jj,r1,r2)
{
cell(jj,3) = x;
};
r1 += t;
};

Hope it can help.

quote:
Originally posted by meili_yang

Hi,

I think there is not a direct way to plot like that. You might try to use some scripts to generate a new column, then plot histogram from there.

Regards,


quote:
Originally posted by spirittoto

Origin Ver.9:
Operating System: 64 win7

Hi all,

I have two columns of data, one is normal data and another one is the number of repetitions of the first data. How to plot a histogram by considering the second column of data?

Thank you in advance!



Meili
OriginLab Tech Support



Meili
OriginLab Tech Support
Go to Top of Page

spirittoto

3 Posts

Posted - 06/27/2013 :  10:21:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Meili,

Thank you and your colleague so much.

This script works well and I get histogram I need.

Regards.

Lang
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