【发布时间】:2021-08-20 13:43:12
【问题描述】:
我正在尝试使用 gnuplot 5.0 创建一个图形,在同一 x 轴上有两个刻度。我已经设法使用 multiplot 选项和以下代码创建了一个:
reset
set terminal pngcairo
set output "test.png"
unset key
set ylabel "Temperature (C)"
set ytics nomirror
set yrange[0:7]
set multiplot layout 1,2
set xrange [0:5.99] #Avoid plotting the last xtics in the first graphic
set xlabel "Heating time (minutes)"
set rmargin at screen 0.7
plot x
set xrange [0:4]
set xlabel "Seconds after stop"
set rmargin
set lmargin at screen 0.7
set xtics 1
unset ylabel
unset ytics
set y2tics nomirror
set format y2 ''
f(x) = a * exp (-x*b)
a=6
b=1
plot f(x)
有了这个结果:
我想生成几张像这样的图像并将它们添加到多图排列中,但我不确定使用嵌套多图是否容易。有没有更简单的方法可以在不使用 multiplot 的情况下获取每个图像,比如将 xaxis 分成两个组件?
提前致谢。
【问题讨论】:
-
您想绘制像示例中的
x或f(x)之类的函数还是数据文件中的数字数据?您的输入数据如何?请举个例子。
标签: gnuplot