You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

gnuplot中透明度与反转色箱结合导致颜色不一致问题咨询

gnuplot中透明度与反转色箱的兼容性问题

在gnuplot中同时使用透明度和反转色箱时,遇到以下异常:

  • 色箱显示的颜色与绘图实际使用的颜色不匹配
  • 部分场景下,即使绘图元素已应用透明度设置,色箱仍保持完全不透明

该不一致行为与所使用的终端(wxt、pngcairo、pdfcairo、svg)及gnuplot版本(已测试5.4.10、6.0.rc1、6.0.3)相关,疑似与某已知bug有关联。

此外,svg终端存在图表标题字体渲染不正确的问题。

测试脚本如下:

reset session
set encoding utf8

#set terminal wxt size 800, 600 font "Arial,12"

#set terminal pngcairo size 800, 600 font "Arial,12"
#set output "png.png"

#set terminal svg size 800, 600 font "Arial,12"
#set output "svg.svg"

set terminal pdfcairo size 8, 6 in font "Arial,14"
set output "pdf.pdf"

$Data << EOD
2561.80   0.348   0.045
2563.60   0.403   0.221
2564.50   0.511   0.132
2565.40   0.491   0.521
2575.43   0.472   0.328
2576.60   0.467   0.570
2577.15   0.490   0.496
2579.80   0.543   0.487
2581.10   0.440   0.571
2583.40   0.510   0.597
2587.13   0.496   0.574
2588.80   0.581   0.568
2590.60   0.586   0.628
2594.20   0.576   0.485
2595.85   0.505   0.345
2596.70   0.395   0.191
2597.55   0.477   0.248
2598.55   0.426   0.151
2599.00   0.506   0.270
2600.35   0.471   0.316
2601.35   0.474   0.283
2603.65   0.474   0.249
2603.95   0.483   0.295
2605.75   0.484   0.263
2606.65   0.434   0.257
2609.00   0.476   0.314
2609.35   0.475   0.259
2610.25   0.486   0.233
2611.15   0.461   0.223
2612.05   0.462   0.131
2612.95   0.476   0.214
2619.00   0.583   0.259
EOD

unset key
set tics out nomirror
set style circle noclip radius graph 0.02

set palette defined (\
 1 "#440154",\
 3 "#21908d",\
 5 "#fde725")

set palette maxcolor 3

set multiplot layout 2,2 title sprintf("Version %g patchlevel %s", GPVAL_VERSION, GPVAL_PATCHLEVEL) font "Arial-Bold"
# ---------
set label 1 "A" at graph 0.1, graph 0.9 font "Arial-Bold,20"
set style fill solid 0.25 border lc ls -1
set title "circles with fill solid 0.25"
plot $Data u 2:3:1 w circles lc palette
# ---------
set label 1 "B"
unset style fill
set style fill transparent solid 0.25 border lc ls -1
set title "circles with fill transp. solid 0.25"
replot
# ---------
set label 1 "C"
set colorbox invert
unset style fill
set style fill solid 0.25 border lc ls -1
set title "circles with fill solid 0.25, colorbox invert"
replot
# ---------
set label 1 "D"
unset style fill
set style fill transparent solid 0.25 border lc ls -1
set title "circles with fill transp. solid 0.25, colorbox invert"
replot
# ---------
unset multiplot
unset output

内容的提问来源于stack exchange,提问作者grsousajunior

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 22:07:12