【问题标题】:Plotting a coordinate system with gnuplot使用 gnuplot 绘制坐标系
【发布时间】:2019-08-22 17:42:08
【问题描述】:
一般来说,我喜欢 gnuplot 图的外观。但是,我必须为一群只见过 x=0 和 y=0 轴的旧式/传统 x-y 坐标系的人准备一个情节。为了不混淆他们,我会坚持他们喜欢的风格。
如何在 gnuplot 中实现这一点?
我找到了set xzeroaxis,它给了我 x 轴。 (类似于 y 轴)。我仍然需要:
- 摆脱框架
- 将 tic 标签/数字放在 x/y 轴上
- 在轴的末端有一个箭头
我怎样才能做到这一点?
【问题讨论】:
标签:
gnuplot
coordinate-systems
【解决方案1】:
set xzeroaxis
set yzeroaxis
set border 0 # remove frame
set xtics axis # place tics on axis rather than on border
set ytics axis
set ticscale 0 # [optional] labels only, no tics
set xtics add ("" 0) # suppress origin label that lies on top of axis
set ytics add ("" 0) # suppress origin label that lies on top of axis
#
# if arrows are wanted only in the positive direction
set arrow 1 from 0,0 to graph 1, first 0 filled head
set arrow 2 from 0,0 to first 0, graph 1 filled head
#
# if arrows in both directions from the origin are wanted
set arrow 3 from 0,0 to graph 0, first 0 filled head
set arrow 4 from 0,0 to first 0, graph 0 filled head
plot f(x)