Author |
Topic |
|
spirittoto
3 Posts |
Posted - 06/27/2013 : 12:18:37 PM
|
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
|
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_yang
103 Posts |
Posted - 06/27/2013 : 5:39:27 PM
|
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 |
|
|
spirittoto
3 Posts |
Posted - 06/27/2013 : 10:21:21 PM
|
Hi Meili,
Thank you and your colleague so much.
This script works well and I get histogram I need.
Regards.
Lang |
|
|
|
Topic |
|
|
|