为什么我使用多轴功能时右边两个轴有问题?
Why do I have a problem with the two axes on the right when I use the multi-axis function?
我在定义图形中的轴时遇到了一系列问题,我想与您分享,看看我们是否能找到错误
我在这个网站上找到了一个相似的用户。我的想法是左边一根轴右边两根。但出于某种原因,它可能很愚蠢,没有正确显示。
我的代码如下:
set terminal postscript eps enhanced color "Times-Roman" 15
set output "TC_8.eps"
set multiplot
set xlabel "Temperature/{/Symbol 0} C"
set xrange [0:1500]
set key off
set autoscale y
set autoscale y2
##### first plot
set yrange[0:15]
set ylabel "Thermal Diffusivity/(mm^2/s)" textcolor rgb "red"
plot "dt8.txt" using 1:2 smooth cspline lc rgbcolor "red"
##### Second plot
set y2range[0:40]
set y2tics nomirror
set y2label "Thermal Conductivity/ (W/m K))" offset 8, 0 textcolor rgb "green"
plot "dt8.txt" using 1:4 axes x1y2 smooth cspline lc rgbcolor "green"
##### Third plot
set y2range[0:2]
set y2tics no mirror
set y2label "Specific Heat/ (J/(g K))" offset 16, 0 textcolor rgb "blue"
plot "dt8.txt" using 1:3 axes x1y2 smooth cspline lc rgbcolor "blue"
unset multiplot
而且数据系列很简单
20 11.466 0.733 28.894
499.6 6.338 1.119 24.38
998.9 5.3 1.292 23.542
1499 4.639 1.645 26.247
问题是右边的两个坐标轴显示不正确,数据线……也一样。
提前致谢
不要犹豫,附上你的绘图结果,并在你发现类似的地方给出参考。
一种方法可能是更改图表的边距并为第三(分离的)轴绘制另一个虚拟图表。顺便说一句,你可以把两条数据线放在一个图中。
代码:(编辑:修改使其复制粘贴包括数据)
### 3 y-axes
reset session
$Data <<EOD
20 11.466 0.733 28.894
499.6 6.338 1.119 24.38
998.9 5.3 1.292 23.542
1499 4.639 1.645 26.247
EOD
set key off
set autoscale y
set autoscale y2
set lmargin 10
set tmargin 2
set bmargin 4
set rmargin 20
set multiplot
##### first plot
set xlabel "Temperature / {/Symbol 0}C" font ",11"
set xrange [0:1500]
set ylabel "Thermal Diffusivity / (mm^2/s)" textcolor rgb "red" font ",11"
set yrange[0:16]
set ytics nomirror
set y2range[0:40]
set y2tics nomirror
set y2label "Thermal Conductivity / (W/m K)" offset -1,0 textcolor rgb "green" font ",11"
set grid xtics, ytics
plot $Data u 1:2 axes x1y1 smooth cspline lc rgbcolor "red", \
'' u 1:4 axes x1y2 smooth cspline lc rgbcolor "green"
##### Second plot
unset xlabel
unset ylabel
unset y2label
unset tics
set y2range[0:2]
plot $Data u 1:3 axes x1y2 smooth cspline lc rgbcolor "blue"
##### Third plot
set rmargin 10
set border 8 # only right border visible
set y2label "Specific Heat/ (J/(g K)" offset -1,0 textcolor rgb "blue" font ",11"
set y2tics nomirror offset 0,0
plot NaN # plot nothing
unset multiplot
### end of code
结果:
我在定义图形中的轴时遇到了一系列问题,我想与您分享,看看我们是否能找到错误
我在这个网站上找到了一个相似的用户。我的想法是左边一根轴右边两根。但出于某种原因,它可能很愚蠢,没有正确显示。
我的代码如下:
set terminal postscript eps enhanced color "Times-Roman" 15
set output "TC_8.eps"
set multiplot
set xlabel "Temperature/{/Symbol 0} C"
set xrange [0:1500]
set key off
set autoscale y
set autoscale y2
##### first plot
set yrange[0:15]
set ylabel "Thermal Diffusivity/(mm^2/s)" textcolor rgb "red"
plot "dt8.txt" using 1:2 smooth cspline lc rgbcolor "red"
##### Second plot
set y2range[0:40]
set y2tics nomirror
set y2label "Thermal Conductivity/ (W/m K))" offset 8, 0 textcolor rgb "green"
plot "dt8.txt" using 1:4 axes x1y2 smooth cspline lc rgbcolor "green"
##### Third plot
set y2range[0:2]
set y2tics no mirror
set y2label "Specific Heat/ (J/(g K))" offset 16, 0 textcolor rgb "blue"
plot "dt8.txt" using 1:3 axes x1y2 smooth cspline lc rgbcolor "blue"
unset multiplot
而且数据系列很简单
20 11.466 0.733 28.894
499.6 6.338 1.119 24.38
998.9 5.3 1.292 23.542
1499 4.639 1.645 26.247
问题是右边的两个坐标轴显示不正确,数据线……也一样。
提前致谢
不要犹豫,附上你的绘图结果,并在你发现类似的地方给出参考。
一种方法可能是更改图表的边距并为第三(分离的)轴绘制另一个虚拟图表。顺便说一句,你可以把两条数据线放在一个图中。
代码:(编辑:修改使其复制粘贴包括数据)
### 3 y-axes
reset session
$Data <<EOD
20 11.466 0.733 28.894
499.6 6.338 1.119 24.38
998.9 5.3 1.292 23.542
1499 4.639 1.645 26.247
EOD
set key off
set autoscale y
set autoscale y2
set lmargin 10
set tmargin 2
set bmargin 4
set rmargin 20
set multiplot
##### first plot
set xlabel "Temperature / {/Symbol 0}C" font ",11"
set xrange [0:1500]
set ylabel "Thermal Diffusivity / (mm^2/s)" textcolor rgb "red" font ",11"
set yrange[0:16]
set ytics nomirror
set y2range[0:40]
set y2tics nomirror
set y2label "Thermal Conductivity / (W/m K)" offset -1,0 textcolor rgb "green" font ",11"
set grid xtics, ytics
plot $Data u 1:2 axes x1y1 smooth cspline lc rgbcolor "red", \
'' u 1:4 axes x1y2 smooth cspline lc rgbcolor "green"
##### Second plot
unset xlabel
unset ylabel
unset y2label
unset tics
set y2range[0:2]
plot $Data u 1:3 axes x1y2 smooth cspline lc rgbcolor "blue"
##### Third plot
set rmargin 10
set border 8 # only right border visible
set y2label "Specific Heat/ (J/(g K)" offset -1,0 textcolor rgb "blue" font ",11"
set y2tics nomirror offset 0,0
plot NaN # plot nothing
unset multiplot
### end of code
结果: