在gnuplot的R式点背景

时间:2013-11-27 20:42:22

标签: r gnuplot

我最近从R切换到gnuplot,用于在我的实验报告中绘制图表。我已经习惯了R使点像白色背景的黑色戒指的方式:

points(x, y, pch=21, bg="white")

有没有办法用gnuplot重现相同的效果?到目前为止,我已经使用了以下内容,但这种方法的缺点是,当它们距离太近时,这些点会“合并”在一起。

plot 'mypoints.dat' w p pt 7 ps 2 lc rgb 'black', \
     'mypoints.dat' w p pt 7 ps 1.9 lc rgb 'white'

点型6在这里没有帮助,因为这些点不是相互叠加而是通过。

我非常感谢能解决我的问题。

非常感谢。

1 个答案:

答案 0 :(得分:1)

您可以使用circles绘图样式绘制实心圆圈:

set style circle radius char 1
plot 'mypoints.dat' with circles fc rgb 'white' fs solid border lc rgb 'black'

radius后面的值可以用不同的“单位”(firstsecondgraphscreencharacter给出,见help coordinates)。使用char可以独立于轴刻度指定半径。或者,您可以在using语句中给出第三个常量值。然后以first单位给出,即使用x轴的缩放:plot 'mypoints.dat' using 1:2:(0.1) with circles ...

为了说明这一点,请考虑以下脚本

set samples 100
set style circle radius char 1
set xrange[0:1]
plot '+' using (rand(0)):(rand(0)) with circles fc rgb 'white' fs solid border lc rgb 'black'

结果(用4.6.4):

enter image description here