【问题标题】:Use default linecolor as textcolor使用默认线条颜色作为文本颜色
【发布时间】:2021-09-14 19:04:37
【问题描述】:

Gnuplot 有一些默认的线条颜色。

如何使用textcolor 调用这些颜色?他们的名字/标识符是什么?

我尝试做这样的事情:

set ylabel 'A' textcolor 'linecolor1'
set ylabel 'B' textcolor 'linecolor2'

我知道this,但我想避免自己提取值并改为调用它们的标识符。

【问题讨论】:

  • 值是什么意思,标识符是什么意思?也许对应的一对0x9400d3dark-violet,分别?
  • 在您的示例中,0x9400d3 是值,dark-violet 是指向该值的标识符。我想要第 1 行、第 2 行等颜色的值标识符。
  • 并非每个代码/值都有标识符/名称。只有 111 种预定义的 gnuplot “命名”颜色。在此处查看它们的可视化:stackoverflow.com/a/54659829/7295599

标签: gnuplot


【解决方案1】:

检查help colorspec。我猜你正在寻找这样的东西:

代码:

### linecolors as textcolors
reset session

set label 1 at graph 0.2, 0.6 "Linecolor 1" tc lt 1
set label 2 at graph 0.2, 0.7 "Linecolor 2" tc lt 2
set label 3 at graph 0.2, 0.8 "Linecolor 3" tc lt 3
set label 4 at graph 0.2, 0.9 "Linecolor 4" tc lt 4
set key top left
plot x, 2*x, 3*x, 4*x

### end of code

结果:

【讨论】:

  • 谢谢!我试过linetype 1 而不是lt 1linetype 1 没用。
  • @Narann 很有趣。文档清楚地表明linetype 1 也应该有效。文档中的错误!?
猜你喜欢
  • 2021-07-12
  • 2017-06-24
  • 1970-01-01
  • 1970-01-01
  • 2013-02-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-30
相关资源
最近更新 更多