2017-11-23 25 views
0

私はdropboxから利用できる一連のデータ(1列)を持っています。ドロップボックスには、次の数値を生成するgnuplotコードもあります。: Not normalized histogram for velocitiesおよびNot normalized distribution for the radius。私は何をしたいのは、次のgnuplotで正規化されたヒストグラムをプロットする

  1. ノーマライズは速度として半径グラフはとして素敵にし、可能な場合は両方拡大するgnuplotの
  2. を使用して、両方のヒストグラムです。

私はgnuplotでヒストグラムに使用されていないため、この問題は1週間以来直面しています。ここにgnuplotコードがあります:

reset 
set terminal pngcairo 
set output 'r_distr_3ev.png' 
set key off 
set border 3 

set boxwidth 0.05 absolute 
set style fill solid 1.0 noborder 

bin_width = 0.005; 

bin_number(x) = floor(x/bin_width) 

rounded(x) = bin_width * (bin_number(x) + 0.00025) 

plot 'data_prob_distr_funct_radius_3eV.dat' using (rounded($1)):(1) 
smooth frequency with boxes 


reset 
set terminal pngcairo 
set output 'v_distr_3ev.png' 
set key off 
set border 3 

set boxwidth 0.05 absolute 
set style fill solid 1.0 noborder 

bin_width = 0.1; 

bin_number(x) = floor(x/bin_width) 

rounded(x) = bin_width * (bin_number(x) + 0.5) 

plot 'data_prob_distr_funct_veloci_3eV.dat' using (rounded($3)):(1) 
smooth frequency with boxes 

ここには、データのサンプルがあります(ファイルが長すぎて完全に投稿できません)。ただし、プロットコマンドでデータソースを編集する必要があります。

# radius      # Velocities 
1.432710516747764062   0.518383911504932460 
1.415400787912409752   0.117744310428800222 
1.420463215076467778   0.083766261830559782 
1.437922410272506557   0.309560054349534541 
1.420463215076467778   0.268622745024368170 
1.438756837417662471   0.203390900905284472 
1.418356121124933145   0.518346867895466801 
1.438756837417662471   0.182812150806309304 
1.421657988632006209   0.299301056216330852 
1.432074613018175180   0.293967535681474712 
1.421657988632006209   0.183613746565735064 
1.412588932829508259   0.501168210407462289 
1.416512172894701438   0.179507944624779481 
1.412588932829508259   0.029653108171494944 
1.417995684224648612   0.234379565912604448 
1.417914885270917580   0.255589209064060963 
1.417995684224648612   0.539792616529789826 
1.408834060670934862   0.256331796703176962 
1.423042784959195561   0.082132902455306064 
1.408834060670934862   0.198595146234998993 
1.432298354037856436   0.255681807316227472 
1.406168218647184665   0.595524682621352608 
1.432298354037856436   0.150127810412636647 
1.431591815111461719   0.271379130577297567 
1.422276604689641788   0.367863070449541862 
1.431591815111461719   0.135432525011420862 
1.431551259009345989   0.138525547190355175 
1.400408991855918162   0.626963309755715237 
1.431551259009345989   0.294435076616490321 
1.425580611910310047   0.527847978352356417 

乾杯

+0

gnuplotコードをここに掲載してください。私はむしろそれをダウンロードしない。私は正規化されたヒストグラムを生成する方法を知っています。どのようにしたいのかと一貫していることを確認したい。また、あなたのデータも投稿してください。 – Ptheguy

+0

私は今スレッドでいくつかのアップグレードを行った。 – ManyBertin

+0

回答が役に立ちましたか? – Ptheguy

答えて

0

は正規化ヒストグラムを取得するには、比例して各データポイントのカウントをインクリメントする必要があります。これは、これに変換します。sumは、データエントリの数がある

plot 'file.dat' u (rounded($1)):(1./(sum*bin_width)) smooth freq w boxes 

。あなたのプログラムからすでにsumがわからない場合、あなたはこのようにそれを得ることができます。同じ(すてき)を見るために2つのヒストグラムを取得するには

stats file.dat 
sum=floor(STATS_records/100.) 

、同じ値にboxwidthbin_widthを設定します。