透明背景图片和某些点的颜色

Transparent background picture and the color of certain points

基本上我有一张图片,它是一组复杂形状的集合,有自己的轴和不同的颜色,还有一组点数据,我可以在它上面绘制,效果很好,请参阅最小化代码示例。我正在使用 fortran 生成 gnuplot 命令文件和 运行 gnuplot.

plot "Random.png" binary filetype=png with rgbimage axis x2y2, "xydata1.dat" using 1:2 with points axis x1y1

我的问题是图片很难看到上面的点。由于形状有很多不同的颜色,所以不可能为所有形状上清晰可见的点选择一种颜色。

那么是否可以将图片以 50% 的透明度放在背景中,而无需在另一个程序中使其透明?

是否可以获取点位置的背景颜色,以便自动确定它们所处的形状?

您可以使用 rgbalpha 绘图样式并指定明确的透明度值:

plot "Random.png" binary filetype=png using 1:2:3:(127) with rgbalpha axis x2y2\,
     "xydata1.dat" using 1:2 with points axis x1y1

透明度值必须介于 0(完全透明)和 255(完全不透明)之间。