【问题标题】:Latex figure caption overlaps gnuplot figure generated with the epslatex terminal乳胶图标题与使用 epslatex 终端生成的 gnuplot 图重叠
【发布时间】:2014-07-01 20:08:29
【问题描述】:

我必须绘制 4 个图,它们之间没有垂直空格,并在我的 tex 文档中添加标题。问题是标题与 x 轴标签重叠,因为底部边距为零,我认为。

gnuplot 文件是这样的

set term epslatex
set output 'foo.tex'

set xrange [-1:1]
set yrange [-1:1]

set multiplot layout 4,1
set ylabel '$y$'
unset xlabel
unset xtics
set tmargin 0
set bmargin 0
plot x w lines
plot x*x w lines
plot x*x*x w lines
set xlabel '$x$'
set xtics
plot x*x*x*x w lines
unset multiplot

tex 文件是

\documentclass[a4paper,11pt]{toptesi}
\usepackage{graphicx}

\begin{document}

\begin{figure}
\input{foo}
\caption{bla bla}
\end{figure}

\end{document}

并且“bla bla”出现在 x 标签上......我试图在最后一张图之前放置一个 set bmargin “something”,但这有一个问题,即最后一张图的大小不再是前三个...如何固定绘图的大小但允许 tex 标题的 bmargin?

【问题讨论】:

  • 我认为解决问题的方法比使用边距更优雅...
  • @bluePhalvio 为什么不在你的 tex 文档中使用vspace。像vspace 0.15in 或任何有用的垂直间距。你可以在\input{foo}\caption{bla bla}之间插入这个
  • 带反斜杠offcourse:\vspace {0.15in}
  • 非常感谢!!!它是如此简单,而且效果很好!
  • 需要我说它增加了垂直空间:)

标签: latex gnuplot margins caption


【解决方案1】:

试试这个代码...

set term epslatex size <width> <height>
set output 'foo.tex'

set xrange [-1:1]
set yrange [-1:1]

set multiplot
# setup sizes of single plots
set size 1,.25
set ylabel '$y$'
unset xlabel
unset xtics
set tmargin 0
set bmargin 0
# set bottom left corner of current plot
set origin 0,.75
plot x w lines
set origin 0,.5
plot x*x w lines 
set origin 0,.25
plot x*x*x w lines
set xlabel '$x$'
set xtics 
# set bmargin back
set bmargin 3 #might be enought for place xlabel, try it...
set origin 0,0 
plot x*x*x*x w lines

unset multiplot
set out
set term pop

但是...底部面板比其他面板小,因此您必须增加底部面板的垂直尺寸(使用set size 1, aa&gt;0.25并减小其他面板的垂直尺寸(set size 1, b在每个绘图命令之前)并满足那a+3b=1。这种微调将取决于 epslatex 终端的大小参数。

更好的解决方案可能是这样的:

 ...
 set size 0,.25
 set tmargin 0
 set bmargin 1
 set origin .75,0
 plot ...
 set tmargin -1
 set bmargin 2
 set origin .5,0
 plot ...
 set tmargin -2
 set bmargin 3
 set origin .25,0
 plot ...
 set tmargin -3
 set bmargin 4
 set origin .25,0
 plot ...

现在我们可能有足够的空间放置底部 xlabel 并且所有面板都具有相同的高度。 不幸的是,gnuplot 4.6.3 将tmargin -3 解释为tmargin 0。所以我们现在不能使用它......可能在一些更新的版本中。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-22
相关资源
最近更新 更多