2016-06-07 22 views
1

以下是我使用的代碼,下面是我的輸出。我想刪除我的子圖和x標籤之間的所有空格。我最需要的一個樣本在鏈接中提供,唯一的區別是我需要所有的框都是相同的大小。Multiplot垂直堆疊在一起,在gnuplot中具有相同的x軸

set terminal jpeg 

set output "mul.jpeg" 

set multiplot 

set xr[0:10] 
set ylabel "y" 
set format y "" 
set key off 

set size 1,0.25 

set origin 0.0,0.0; 
set xlabel "x" 
plot sin(x) 
replot sin(2*x) 

set origin 0.0,0.25; 
set format x "" 
plot cos(x) 
replot cos(2*x) 

set origin 0.0,0.50; 
set format x "" 
plot sin(x) 

set origin 0.0,0.75; 
set format x "" 
plot cos(x) 

unset multiplot 

multiplot_example

我真正需要的是這樣的:

https://inspirehep.net/record/1345236/files/hada_fig2.png

感謝您的幫助!

+2

參見例如http://stackoverflow.com/a/19133002/2604213 – Christoph

+0

謝謝@Christoph。我錯過了利用利潤。 – AK02

回答

1

一種方法是使用multiplot layout,但它是一個麻煩得到它很好用的標籤和抽動(因爲他們overlapp或不適合在畫布)

set terminal jpeg 

set output "mul.jpeg" 

set tmargin 0 
set bmargin 0 
set lmargin 1 
set rmargin 1 

unset xtics 
unset ytics 
set multiplot layout 4,1 

set xr[0:10] 
plot sin(x), sin(2*x) 
plot cos(x), cos(2*x) 
plot sin(x) 
plot cos(x) 

unset multiplot 

另一種可能性是設置邊緣和/或單獨的每個情節的起源在這些所謂的答案解釋:multiplot - stacking 3 graphs on a larger canvasHow do gnuplot margins work in multiplot mode?

2

從gnuplot的5.0,你可以使用@Raphael_Roth設置margins爲零所提供的解決方案,但也應該使用margins選項的multiplot ,爲底部的tic標籤和xlabel留出空間。

E.g,

set tmargin 0 
set bmargin 0 
set lmargin 1 
set rmargin 1 

set multiplot layout 4,1 margins 0.05,0.95,.1,.99 spacing 0,0 

set xrange [0:10] 
unset xtics 
plot sin(x), sin(2*x) 
plot cos(x), cos(2*x) 
plot sin(x) 

set xtics 
plot cos(x) 

unset multiplot 
+0

它指向'多邊形佈局中的邊緣'4,1邊距0.05,0.95,.1,.99間距0,0'說「無效或重複選項」 – AK02

+0

你有哪個版本的gnuplot?這從5.0開始,我會添加回答。 – Joce

+0

哦,好的。我有4.6。感謝你的回答! – AK02