f



Bounding box?

A program generates 3 files, stst.dat, march1.dat and march2.dat,
and I have file 0.8 lying (a vertical line). I use this script:

#------------------------------ gnuplots
#
gnuplot << eoi
set term postscript eps enh 24
set output 'march.slab.eps'
set nokey
set size 1, 2.1
set pointsize 2.0
set multiplot
#                      u_0 vs delta:
set size 1, 1
set origin 0, 1.05
set xrange [0:1]
set yrange [0:3]
set ytics 0, 1, 3
set xlabel '{/Symbol=28 d}'
set ylabel '{/Italic=28 u_0}' rotate by 0
plot 'stst.dat' w l lt 1, '0.8' w l lt 0
#                      time march to stst
set origin 0, 0.05
set size 1, 1
set xrange [0:10]
set yrange [0:1.8]
set ytics 0, 0.5, 1.5
set nolabel
set xlabel '{/=28 t}'
set ylabel '{/Italic=28 u_0}' rotate by 0
set label 'u_0 start at 0' at 0.8, 0.35
set label 'u_0 start at 1.3' at 2, 1.4
plot 'march1.dat' w l lt 1, 'march2.dat' w l lt 1
quit
eoi

This generates the plot march.slab.eps. When I then compile
the LaTeX document that includes it, I get the error message

! LaTeX Error: Cannot determine size of graphic in march.slab (no
BoundingBox).

I do the same thing with other plots and do not get this message.
How do I fix this? I guess I had better also show the bit of LaTeX code that
is supposed to do this:

\begin{figure}[!pt]%
\begin{center}
\includegraphics*[width=0.8\textwidth]{march.slab}
\caption{blabla.}\label{Fig:march.slab}
\end{center}
\end{figure}

(and I use the packages eepic and graphicx, yes).
-- 
Dieter Britz (dieterhansbritz<at>gmail.com)
0
Dieter
3/22/2011 2:53:35 PM
comp.graphics.apps.gnuplot 5008 articles. 0 followers. Post Follow

3 Replies
750 Views

Similar Articles

[PageSpeed] 17

On 22.03.2011 15:53, Dieter Britz wrote:
>
> gnuplot<<  eoi
> set term postscript eps enh 24
> set output 'march.slab.eps'
> eoi
>
> This generates the plot march.slab.eps. When I then compile
> the LaTeX document that includes it, I get the error message
>
> ! LaTeX Error: Cannot determine size of graphic in march.slab (no
> BoundingBox).
>
> I do the same thing with other plots and do not get this message.
> How do I fix this? I guess I had better also show the bit of LaTeX code that
> is supposed to do this:
>
> \begin{figure}[!pt]%
> \begin{center}
> \includegraphics*[width=0.8\textwidth]{march.slab}
> \caption{blabla.}\label{Fig:march.slab}
> \end{center}
> \end{figure}

If you use a filename with more than one dot you must specify the 
complete filename including the extension in \includegraphics. Although 
in my test case LaTeX complained about a missing file, you could have 
the same problem, so try using

\includegraphics*[width=0.8\textwidth]{march.slab.eps}

Christoph
0
Christoph
3/22/2011 3:40:10 PM
Am 2011-03-22 15:53, schrieb Dieter Britz:

> set size 1, 2.1

Setting the size > 1 may cause problems since a couple of releases. I 
had used this in earlier scripts, too, but found that it is smoother to 
change the canvas size in the termimal settingn ("set term ...") 
instead. I won't rule out that plotting beyond the postscript bounding 
box max confuse LaTeX.

You can specify the absolute margin positions for each sub-plot by using

set *margin screen <value>

where * stands for "r", "l", "t", "b" (i.e. rmargin, lmargin etc.), and 
<value> is within [0:1]. I.e., in a single plot,

set lmargin screen 0.1
set rmargin screen 0.99
set bmargin screen 0.1
set tmargin screen 0.99

creates a left and bottom margin of 10% of the total plot canvas, 
leaving enough space for margins, and tiny margins at the top and right. 
For multiplots, the canvas must be partitioned into tiles into which the 
subplots fit.

May I ask what exactly you have in mind? What should the multiplot graph 
look like?

-- 
Gru´┐Ż,
       Ingo
0
Ingo
3/22/2011 8:25:46 PM
Ingo Thies wrote:

> Am 2011-03-22 15:53, schrieb Dieter Britz:
> 
>> set size 1, 2.1
> 
> Setting the size > 1 may cause problems since a couple of releases. I
> had used this in earlier scripts, too, but found that it is smoother to
> change the canvas size in the termimal settingn ("set term ...")
> instead. I won't rule out that plotting beyond the postscript bounding
> box max confuse LaTeX.
> 
> You can specify the absolute margin positions for each sub-plot by using
> 
> set *margin screen <value>
> 
> where * stands for "r", "l", "t", "b" (i.e. rmargin, lmargin etc.), and
> <value> is within [0:1]. I.e., in a single plot,
> 
> set lmargin screen 0.1
> set rmargin screen 0.99
> set bmargin screen 0.1
> set tmargin screen 0.99
> 
> creates a left and bottom margin of 10% of the total plot canvas,
> leaving enough space for margins, and tiny margins at the top and right.
> For multiplots, the canvas must be partitioned into tiles into which the
> subplots fit.
> 
> May I ask what exactly you have in mind? What should the multiplot graph
> look like?

Well, it did turn out, the two plots aligned one above the other, on an
upright frame. I didn't know that the extra dot in the name could bugger
the works, thanks, have replaced it with an underscore.

"Canvas" was the key. After a bit of fiddling with the size setting in the
set term statement, and using the total size 1, the picture came out right.
Thanks for the tip.
-- 
Dieter Britz (dieterhansbritz<at>gmail.com)
0
Dieter
3/24/2011 9:36:27 AM
Reply: