Menu

#235 plots with margin in a multiplot with set margins

open
nobody
None
5
2018-05-18
2018-05-18
No

Hello,

I'm using gnuplot 5.2 patchlevel 3 on a windows 10 computer.
I'm trying to plot my datas in a multiplot. I want to have 4 plots and some labels on the rows and columns.
To do that I used a multiplot command with set margins and spacing, to keep the space to put my labels on the top and left sides. But then at the end on the multiplot I have tics overlapping on plots and the xlabels of the bottom plots disappear.
My individual plots are not scaled in the "box" they should fit so that tics and label are inside this box. Instead, the border of the graph are set at the extremity of this box.
I read in the help that normally the plot is automatically scale to fit the space including the tics and y and x labels unless xtics axis is set. I didn't set the xtics axis and I didn't change the font of my labels so I have no idea of why it is not fitting everything in the expected space.

To fix this I tried set l/r/b/t margins for individual plots, but it is setting margins in regards to the full screen and not the ploting space of each individual plot. I also tried to change the scale of the individual plots but it's not making any difference.

Here is the code I'm using :

set loadpath 'C:...'
set datafile separator "\t"
filename = 'file.txt'

set size 1,1
set origin 0,0

set label 1 'MB p25' at screen 0.35,0.95 center
set label 2 'MB p17' at screen 0.75,0.95 center
set label 3 'nIPA' at screen 0.05,0.7 center rotate by 90
set label 4 'IPA V0' at screen 0.05,0.2 center rotate by 90

set arrow 1 from screen 0.2,0.05 to screen 0.2,0.94 lw 8 #to check position of the graph

set multiplot layout 2,2 columnsfirst margins screen 0.2,0.98,0.05,0.94 spacing 0.05,0.02

set border 3
set xtics nomirror
set ytics nomirror
set xlabel "Time (min)"
set ylabel "RFU change"
set autoscale
set key top left

*set lmargin 2
set bmargin 2 *

stats filename nooutput
array A[STATS_columns]

load 'YlOrRd.plt'
unset colorbox
do for [j=5:9:4] {
set cbrange [j-4:j]
do for[i=j-3:j] {
stats filename u i nooutput
A[i-1]=STATS_min
}
set key autotitle columnhead
plot for [n=j-3:j] filename u 1:(column(n)-A[n-1]) w lines lt palette cb n lw 5
}

load 'RdPu.plt'
do for [j=13:17:4] {
set cbrange [j-4:j]
do for[i=j-3:j] {
stats filename u i nooutput
A[i-1]=STATS_min
}
set key autotitle columnhead
plot for [n=j-3:j] filename u 1:(column(n)-A[n-1]) w lines lt palette cb n lw 5
}
unset multiplot

The obtained plots with or without setting margins for individual plots are attached.

I hope someone can help me with this.

Best,

Adèle

1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.