12

有什么方法可以gnuplot在 x 和/或 y 轴上为 tic 标记着色?我正在使用一个png非常暗的背景文件,我希望内部抽动显示为白色,而不是默认的黑色。

4

2 回答 2

16

tics似乎从以下继承了它们的颜色border

set style line 50 lt 1 lc rgb "red" lw 2
set border ls 50
plot sin(x)

textcolortic 标签从以下选项中获取颜色tics

set tics textcolor rgb "red"

(字符串“white”也应该可以工作,但在我的演示中看起来不太好,因为我的背景是白色的)。

没有办法只改变 tic-color。但是,如果需要,您可以更改 tic/border 颜色,然后在顶部添加新边框:

set arrow from graph 0,graph 1 to graph 1,graph 1 nohead ls -1 lc rgb "black" front
set arrow from graph 1,graph 1 to graph 1,graph 0 nohead ls -1 lc rgb "black" front
set arrow from graph 1,graph 0 to graph 0,graph 0 nohead ls -1 lc rgb "black" front
set arrow from graph 0,graph 0 to graph 0,graph 1 nohead ls -1 lc rgb "black" front
于 2012-09-13T14:26:52.500 回答
3

虽然这篇文章已经很老了,但我想提供我的 2 美分,因为我对上述内容有一个有效的补充。

如果您立即使用未设置边框的设置边框命令,则抽动及其标签的颜色将保持您设置的颜色,并且边框将被删除。例如,

set border linecolor rgb "gray75"
unset border

这样,您至少可以更改抽动及其标签的颜色(此处为灰白色),并且您的背景保持黑暗且不受难看的(灰白色)边框的污染,这是 OP 要求的?

因此,无需在上一个答案中手动重绘边框。不过,上面的最佳答案对我很有用,所以我会加分!

于 2018-02-21T16:02:52.607 回答