Page 1 of 1

Multiplot 3 plots with single Y axis

Posted: Sat Jan 08, 2022 5:08 am
by amh
An example of multiplot for 3 plots with one Y axis.

Code: Select all

set terminal pngcairo size 600, 900
set output 'stacking.png'

set lmargin at screen 0.15
set rmargin at screen 0.95

TOP=0.98
DY = 0.29

set multiplot
set offset 0,0,graph 0.05, graph 0.05

set xlabel 'time'
set ylabel 'ylabel 1' offset 1
set tmargin at screen TOP-2*DY
set bmargin at screen TOP-3*DY
set ytics -1000,500,1000
plot 1150*cos(x) title 'First'

set xtics format ''
unset xlabel
set ylabel 'ylabel 2' offset 0
set tmargin at screen TOP-DY
set bmargin at screen TOP-2*DY
set ytics -100,50,100
plot 101*sin(x) title 'Second'

set ylabel 'ylabel 3' offset -1
set tmargin at screen TOP
set bmargin at screen TOP-DY
set ytics -8,4,8
plot 10*sin(2*x) title 'Third'

unset multiplot; set output
References:

https://stackoverflow.com/questions/191 ... ger-canvas