|
From: Christian S. <cbk...@ya...> - 2009-04-28 12:16:38
|
Hi,
Thanks for taking the time to read my question. I posted it yesterday but
I *think* it "disappeared." If it now comes through twice, my sincerest
apologies.
I'm having a problem with fonts (I think) and sizing related to latex
terminals. The plot which I am producing is the following:
*********
set terminal epslatex size 6in,3.5in
set output 'test.tex'
set samples 10000
set xlabel '$\omega$, rad/s' 0,-1
set ylabel 'Signal, $\mathcal{S}(\omega)$'
set ytics ('$0$' 0, '$\frac{\mathcal{S}_0T_{2}^\ast}{2}$' 0.5,
'$\mathcal{S}_0T_{2}^\ast$' 1)
set xtics ('$0$' 0, '$\frac{1}{T_{2}^\ast}$' 1.0,
'$-\frac{1}{T_{2}^\ast}$' -1.0, '$\frac{3}{T_{2}^\ast}$' 3.0,
'$-\frac{3}{T_{2}^\ast}$' -3.0, '$\frac{5}{T_{2}^\ast}$' 5.0,
'$-\frac{5}{T_{2}^\ast}$' -5.0)
set xrange [-6:6]
set yrange [0:1.1]
unset key
unset xzeroaxis
unset yzeroaxis
set arrow from -1,0 to -1,0.5 linestyle 2 nohead
set arrow from 1,0 to 1,0.5 linestyle 2 nohead
set arrow from -1,0.5 to 1,0.5 linestyle 2 nohead
set arrow from 2,0.6 to 1.1,0.51
set label 'FWHM' at 2.2,0.62 left
plot 1./(1.+x**2) with lines 1
************
The problem is that, so long as the "set ytics" line remains, a plot is
produced which is squeezed onto the right side of the page, yet the ylabel
remains way over on the left. There is thus a *huge* space between the
word "Signal" and the (rather crushed) plot. Interestingly, this happens
regardless of whether I use "input" or "standalone" as arguments to
epslatex. Furthermore, it happens even if I change terminal to latex.
Clearly it's a peculiarity with latex-interfacing terminals. If I comment
out the "set ytics" command, numbers replace my labels in the vertical
axis and all becomes well - the correct size plot is produced. It seems as
if gnuplot is assuming that in the ytics labels all of the characters in
all of the latex escape codes are represented in the final plot, which, of
course, when the latex document is compiled, they are not.
How do I fix this? epslatex is really a great terminal and I really wish
to continue using it. Any pointers you could provide me would be much
appreciated. It seems that this problem must appear for anyone who tries
to use latex-interfacing terminals; that I have not yet - despite my best
efforts - found a solution on my own forces me to feel as though I am
missing something obvious. If that's the case, and I'm wasting your time,
I apologize.
Thank you again.
Cheers,
Christian
--
View this message in context: http://www.nabble.com/Plot-size-and-spacing-problem-tp23275857p23275857.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: Hans-Bernhard B. <HBB...@t-...> - 2009-04-28 19:25:08
|
Christian Schroeder wrote: > I'm having a problem with fonts (I think) and sizing related to latex > terminals. Not really. What you're having a problem with is that it's quite impossible for gnuplot to guess what LaTeX will make of a label text. It has no way to position the graph box snugly because it lacks the information for that. > It seems as if gnuplot is assuming that in the ytics labels all of > the characters in all of the latex escape codes are represented in > the final plot, That's exactly what happens, yes. > which, of course, when the latex document is compiled, they are not. There's no way gnuplot could know that, short of re-implementing all of LaTeX. > How do I fix this? See "help xtics" about the "offset" option, I think. |
|
From: Christian S. <cbk...@ya...> - 2009-04-29 01:24:57
|
Thanks for your previous reply.
>> How do I fix this?
> See "help xtics" about the "offset" option, I think.
This helps in that it moves the "ytics" labels that I wish into a spot next
to the the ylabel. Unfortunately, the graph remains squashed onto the right
side of the page! Please see the attached file, which was made using the
following ytics line:
set ytics offset -30 ('$0$' 0, '$\frac{\mathcal{S}_0T_{2}^\ast}{2}$' 0.5,
'$\mathcal{S}_0T_{2}^\ast$' 1)
Any thoughts? Thanks again!
Cheers,
Christian http://www.nabble.com/file/p23289038/absorption_plot.pdf
absorption_plot.pdf
--
View this message in context: http://www.nabble.com/Plot-size-and-spacing-problem-tp23275857p23289038.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: Thomas S. <t.s...@fz...> - 2009-04-29 07:30:51
|
the ytics offset is not the problem, but the automatic calculation of
the left margin. adjust this margin by hand and specify an offset
for the ylabel to get it into the plot. add to the commands in your
first email:
set lmargin 10
set ylabel offset 31,0,0
Christian Schroeder wrote:
>
> Thanks for your previous reply.
>
>>> How do I fix this?
>
>> See "help xtics" about the "offset" option, I think.
>
> This helps in that it moves the "ytics" labels that I wish into a spot
> next to the the ylabel. Unfortunately, the graph remains squashed onto the
> right side of the page! Please see the attached file, which was made using
> the following ytics line:
>
> set ytics offset -30 ('$0$' 0, '$\frac{\mathcal{S}_0T_{2}^\ast}{2}$' 0.5,
> '$\mathcal{S}_0T_{2}^\ast$' 1)
>
> Any thoughts? Thanks again!
>
> Cheers,
>
> Christian http://www.nabble.com/file/p23289038/absorption_plot.pdf
> absorption_plot.pdf
>
--
View this message in context: http://www.nabble.com/Plot-size-and-spacing-problem-tp23275857p23292059.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|