在 Gnuplot 中使用 y 轴和 x 轴映射 y2 轴
我的数据文件如下:
T(K) G(T) K
500.00 53235.1 2.7460E-06
510.00 52213.4 4.4915E-06
520.00 51193.2 7.2062E-06
530.00 50174.7 1.1353E-05
540.00 49157.8 1.7581E-05
550.00 48142.4 2.6787E-05
560.00 47128.7 4.0191E-05
570.00 46116.5 5.9429E-05
580.00 45105.9 8.6672E-05
590.00 44096.8 1.2476E-04
600.00 43089.2 1.7736E-04
610.00 42083.1 2.4917E-04
620.00 41078.5 3.4614E-04
630.00 40075.3 4.7572E-04
640.00 39073.5 6.4719E-04
650.00 38073.1 8.7193E-04
660.00 37074.1 1.1639E-03
670.00 36076.5 1.5398E-03
680.00 35080.1 2.0201E-03
690.00 34085.1 2.6287E-03
700.00 33091.4 3.3943E-03
第一列是温度(开尔文),第二列是吉布斯能量(J),第三列是平衡常数。第三列与第二列相关,即 K=exp(-G/RT)。
我需要 T(K) 与 G(T)(y 轴)和 T(K) 与 K(y2 轴)的关系图。我们可以使用 set link 命令,其中
set link y2 via exp(-y/(8.31452*($1))) inverse -log(y)*8.31452*($1)
$1
指的是温度(第一列)。然后我们可以使用该命令
plot 'data.dat' u 1:2 w l ls 1 title "Gibbs energy'
来绘制数据。 set link
命令中使用的 $1
(第一列)是否正确?
@Ethan 回复后问题已修改
第三列仅作为参考。我希望通过链接 y(线性刻度)来绘制 y2(以对数刻度表示),以便 y 中的每个刻度与 y2 中的每个刻度具有 1:1 对应关系。目的是将显示吉布斯能量的轴与另一个轴连接起来,该轴使用上述关系自动计算平衡常数并将其绘制在logscale
中
My data file is given below
T(K) G(T) K
500.00 53235.1 2.7460E-06
510.00 52213.4 4.4915E-06
520.00 51193.2 7.2062E-06
530.00 50174.7 1.1353E-05
540.00 49157.8 1.7581E-05
550.00 48142.4 2.6787E-05
560.00 47128.7 4.0191E-05
570.00 46116.5 5.9429E-05
580.00 45105.9 8.6672E-05
590.00 44096.8 1.2476E-04
600.00 43089.2 1.7736E-04
610.00 42083.1 2.4917E-04
620.00 41078.5 3.4614E-04
630.00 40075.3 4.7572E-04
640.00 39073.5 6.4719E-04
650.00 38073.1 8.7193E-04
660.00 37074.1 1.1639E-03
670.00 36076.5 1.5398E-03
680.00 35080.1 2.0201E-03
690.00 34085.1 2.6287E-03
700.00 33091.4 3.3943E-03
The first column is temperature (Kelvin), second column is Gibbs energy (J) and third column is equilibrium constant. Third column is related to second column as K=exp(-G/RT).
I need a plot of T(K) vs. G(T) (y-axis) and T(K) vs. K (y2-axis). We can use the set link command as
set link y2 via exp(-y/(8.31452*($1))) inverse -log(y)*8.31452*($1)
where $1
refers to temperature (first column). We can then use the command
plot 'data.dat' u 1:2 w l ls 1 title "Gibbs energy'
to plot the data. Is the use of $1
(first column) in the set link
command correct?
Question modified after response of @Ethan
The third column was given only as a reference. I wish to plot y2 (in logscale
) by linking y (linear scale) so that there is 1:1 correspondence of each tick in y to that in y2. Intention is to link axis showing the Gibbs energy with that of another axis that automatically calculates the equilibrium constant using the above relation and plots it in logscale
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可以。“set link y2”命令中的唯一变量应该是“y”。
我认为您稍微误解了链接命令的想法。它描述了 y1 和 y2 之间的固定关系。如果 y1 和 y2 通过 T 的某个函数相关,那么该关系仅对于 T 的某个特定固定值是“固定的”。
根据您的描述,您需要一个像这样的绘图命令
,但 y1 和 y2 轴不是 链接在此。您将得到两条不同的情节线,因为它们没有链接。如果我误解了您的意图,请修改问题以澄清您想要绘制的内容。
No. The only variable in the "set link y2" command should be "y".
I think you slightly misunderstand the idea of the link command. It describes a fixed relationship between y1 and y2. If y1 and y2 are related by some function of T then that relationship is "fixed" only for some particular fixed value of T.
From your description you want a plot command like
But the y1 and y2 axes are not linked here. You will get two distinct plot lines exactly because they are not linked. If I have misunderstood your intent, please modify the question to clarify what you want to plot.