【发布时间】:2019-08-31 17:51:36
【问题描述】:
请问这张图有什么问题?我想在一张图片中绘制四个图表。它显示两个图形。我想要一个有 3 个标题的图例,因为使用了三种颜色。然后我不知道如何写两个标题 - 一个用于左侧图表,一个用于右侧图表。
我想要 4 个不同的 2x2 绘图 - 我在脚本中有 4 个绘图。我有很多错误。
set tics out nomirror
set encoding iso_8859_1
unset xtics
set ylabel "{/:Italic F} [a. u.]" font "Segoe UI,12" offset 2,0
set ytics nomirror font "Segoe UI,12"
set lmargin screen 0.2 #levý prostor vedle graf
set rmargin screen 0.9 #pravý prostor vedle grafu
set multiplot layout 2,2
set bmargin screen 0.40
set key Left reverse out horiz
set format y "%.2f"
set key tc variable
set xrange [4272:4500]
set yrange [0.7:1.02]
set title "Title 1" font "Segoe UI,12"
set title "Title 2" font "Segoe UI,12"
plot \
x title "Fitted" with lines linecolor rgb "red" lw 1.5,\
x title "Measured" with lines linecolor rgb "black" lw 1.5
unset ytics
set y2tics
set link y2
unset ylabel
set y2label "{/:Italic F} [a. u.]" font "Segoe UI,12" offset 1,0
set tmargin screen 0.4 #posun horní čáry dolního graf
set bmargin screen 0.15 #posun dolní čáry dolního graf
unset key
set tics out nomirror
set xlabel "{/:Italic {/Symbol l}} ({\305})" font "Segoe UI,12"
set xrange [4272:4500]
set yrange [-0.05:0.03]
plot x title "Measured - fitted" with lines linecolor rgb "navy" lw 1.5
set margin
set margin
plot \
x title "Fitted" with lines linecolor rgb "red" lw 1.5,\
x title "Measured" with lines linecolor rgb "black" lw 1.5
set margin
set margin
plot x title "Measured - fitted" with lines linecolor rgb "navy" lw 1.5
【问题讨论】:
-
你期待什么?您正在绘制 4 次,但只有 2 次具有不同的边距。所以 3 个地块是相同的并且彼此重叠。你能描述甚至更好地画出你真正想要实现的目标吗?也许 2x2 布局中有 4 个地块?我不清楚。顺便说一句,你必须
set title ...在绘图命令之前。 -
我编辑了我的问题。
标签: gnuplot