在gnuplot中将y轴添加到多个偏移ytics?

在gnuplot中将y轴添加到多个偏移ytics?,gnuplot,Gnuplot,我正在寻找一段时间来完成我喜欢的情节。事实上,根据这里给出的例子,我有一个左y轴和两个右y轴:我在那里得到的信息按照我希望的那样完成了工作。然而,在我的图中,我希望第二个y值的y轴也在右边。我四处搜索,发现了这个:它与gnuplot无关。所以现在我不知道怎么做,除了,我将使用一个向量,自己构建轴,这可能在定位方面不准确,也不是最好的方法。现在的问题是,我是否可以像使用ytics和Ylabel那样使用偏移量移动图形的右边框?gnuplot的帮助并没有为»border«提供任何东西,但我也可能在错误

我正在寻找一段时间来完成我喜欢的情节。事实上,根据这里给出的例子,我有一个左y轴和两个右y轴:我在那里得到的信息按照我希望的那样完成了工作。然而,在我的图中,我希望第二个y值的y轴也在右边。我四处搜索,发现了这个:它与gnuplot无关。所以现在我不知道怎么做,除了,我将使用一个向量,自己构建轴,这可能在定位方面不准确,也不是最好的方法。现在的问题是,我是否可以像使用ytics和Ylabel那样使用偏移量移动图形的右边框?gnuplot的帮助并没有为»border«提供任何东西,但我也可能在错误的地方搜索

下面给出了图片和gnuplot脚本。然而,我不被允许显示图表,但它在这里不起作用。总而言之:我想在我的eps文件的末尾添加一条红线,我想知道如果不使用箭头并自己构建它,这是否可行。此外,我希望这个问题可能与其他人有关,以前没有被问到和解决过。否则我的搜索调查就糟了。先谢谢你

#!/bin/gnuplot
#
# Tobias Holzmann
# 05.09.2017
# Multiplot for 3 y-axis
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

clear
reset

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

set output "PowerControl.tex"
set terminal epslatex
set key nobox
set ytics out
set y2tics out
set ytics nomirror

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

set style line 1 lw 1.7 lc rgb 'black' ps 0.7 pt 7
set style line 2 lw 1.5 lc rgb 'black'
set style line 3 lw 1.3 lc rgb 'black' dashtype 4

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

set multiplot
set xrange [0:60]
set rmargin screen 0.8
set lmargin screen 0.10

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

set xlabel "Time [s]"
set ylabel "Amount of inserted energy [-]"
set ylabel offset 3,0
set yrange [0:.4]
set ytics \
("None" 0.00, "" 0.05, "" 0.1, "" 0.15, "Moderate" 0.2, \
 "" 0.25, "" 0.3, "" 0.35, "High" 0.4)

unset y2tics

set key at graph 0.95,0.22
set key height 0.3

plot \
"timePower" using 1:2 w lp ls 1 t 'Energy insertion'

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

#unset ytics
#unset xtics
unset ylabel

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

set grid
set y2tics 10
set y2tics out
set y2range [0:80]
set y2label "Von Mises Stress [MPa]"
set key at graph 0.95,0.315
set key height 6

plot \
"timeVonMises" using 1:2 w l ls 2 t 'Von Mises Stress' axis x1y2

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

unset grid
unset ytics
unset ylabel

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

set y2tics 75
set y2range [0:600]
set y2tics offset 8, 0
set y2label "Maximum Temperature [$^{\\circ} $C]" offset 8,0
set key at graph 0.95,0.10
set key height 0.3

plot \
"timeTMax" using 1:($2-273.15) w l ls 3 t 'Temperature' axis x1y2

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

unset multiplot

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


PS:基于我的低声誉点,我不允许直接放图片(很遗憾)。

在检查了gnuplot等的手册页后。我想我不可能想要它。但是,使用了一种快速而简单的解决方法(如do[]{}中已经提到的向量)。我的建议如下:

set arrow 1 from graph 1.20,0 to graph 1.20,1 nohead lw 1

do for [i=0:8] {
set arrow from graph 1.20,i/8. to graph 1.21,i/8. nohead lw 1
}
结果在上面的图片(或链接)中给出。也许有人可以将其用于想要制作的单独绘图。如果有人知道更好的解决方案,请让我们知道

问候 托拜厄斯


对于最后一个数据集,您可以先绘制数据,而不显示
y2
轴,然后制作一个单独的绘图,只显示
y2
轴而不显示数据。然后您可以自由地相对定位两个绘图。确保两个绘图使用相同的高度非常重要(这可以通过设置上下页边距来实现)和相同的数字范围(如果您固定范围,这很简单;如果您想使用自动缩放
y2
轴,则可以使用
写回
/
恢复

例如:

reset
set multiplot

# first, draw the graph without y2 axis
set tmargin 1
set bmargin 3
set rmargin 20

set xtics nomirror
unset ytics
unset y2tics
unset key
set border 1                 # draw only the bottom border (the x axis)
set y2range [] writeback     # use autoscaling for y2 and store the range
plot sin(x) axes x1y2


# now draw only the y2 axis, with the range from the previous plot
set y2range restore
set rmargin 10
set border 8     # draw only the right border (the y2 axis)
unset xtics
set y2tics
plot 1/0 axes x1y2

unset multiplot
给予