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

如何在gnuplot中修改标签颜色?含θ₁标签设蓝色需求

修改Gnuplot中θ₁标签的颜色为蓝色

没问题!要把你的θ₁(代码里的{/Symbol q_1})标签改成蓝色,只需要调整对应set label命令里的颜色参数就行。

关键修改点

在你设置标签1的那一行,原来的textcolor 3对应绿色,你只需要把它改成蓝色对应的参数:

  • 用默认调色板的颜色编号的话,蓝色是textcolor 4
  • 想指定精确蓝色的话,也可以用RGB值,比如textcolor rgb "#0000FF"或者textcolor rgb "blue"

修改后的完整代码

set term post eps color enhanced "Times-Roman" 18
set encoding utf8
a = 0.5
f(x) = a*x/(1 + a*x)
c(x) = 0.95
x1=38
set xrange [0:100]
set yrange [0:1.2]
set arrow 1 from x1,graph 0 to x1,f(x1) lt 2 lc 3 nohead
# 这里修改了textcolor参数为4(蓝色)
set label 1 at x1,graph 0 "{/Symbol q_1}" textcolor 4 offset 0.5,0.75
set label 2 at 0,0.95 "0.95" textcolor 7 offset -3.5,0
set output 'test-label.eps'
plot f(x) with line lw 2 lc 3 ,\
c(x) with line lw 2 lc 7

补充说明

Gnuplot默认的颜色编号对应:1=黑色,2=红色,3=绿色,4=蓝色,5=品红,6=青色,7=黄色。如果需要自定义颜色,用rgb参数可以更灵活地指定十六进制颜色值或者颜色名称。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 08:24:37