2017-02-21 298 views
1

我有x和y數據點表示一個星團。我想使用Gnuplot及其重疊點的散射函數來顯示密度。Gnuplot:散點圖和密度

我用下面的命令:

set style fill transparent solid 0.04 noborder 
set style circle radius 0.01 
plot "data.dat" u 1:2 with circles lc rgb "red" 

結果:

enter image description here

不過,我想這樣的事情

enter image description here

這有可能在gnuplot的?有任何想法嗎?

回答

1

它是一個選項後處理與imagemagick圖像?

# convert into a gray scale image 
convert source.png -colorspace gray -sigmoidal-contrast 10,50% gray.png 

# build the gradient, the heights have to sum up to 256 
convert -size 10x1 gradient:white-white white.png 
convert -size 10x85 gradient:red-yellow \ 
        gradient:yellow-lightgreen \ 
        gradient:lightgreen-blue \ 
     -append gradient.png 
convert gradient.png white.png -append full-gradient.png 

# finally convert the picture 
convert gray.png full-gradient.png -clut target.png 

我還沒有嘗試,但我很確定gnuplot可以直接繪製灰度圖像。

這裏是(旋轉)梯度圖像: rotated gradient

這是結果: colored scatter plot

+0

尼斯替代!但我真的需要Gnuplot的解決方案。 – Samuel