-1

I am trying to adjust the horizontal spacing of letters in subscript in the postscript (enhanced) terminal. The default is to align the spacing as you would for normal letters, but for big letters such as P, the subscripted letter appears too far away. Is there a way to adjust the spacing of subscripted letters?

Edit: minimal example, as requested. My use case is with Times-Italic font, so that's what I've done here, but the look is similar with Times-Roman

set term post enh eps font "Times-Italic" 
set output "test.eps"
set title "{P_{/*0.75 C}}"
plot sin(x)
set output

Edit 2: I'm pretty sure the reason is that the typesetter is aligning the left side of the second letter at the right edge of the first letter, but for letters like P where there is a large space between the bottom left corner and furthest right point, it doesn't look very nice when a letter is subscripted next to the P (or T, etc.)

darthbith
  • 18,484
  • 9
  • 60
  • 76
  • Can you post a minimal example that demonstrates the problem? I tried `set term post enh; set output 'foo.ps'; set label 1 "Foo_P" at 0,0; plot sin(x)` and IMHO, the output looked just fine. – mgilson Jun 04 '13 at 11:47
  • @mgilson I think it looks acceptable, but I'm curious if there's a way I can improve it :-) – darthbith Jun 04 '13 at 14:43

1 Answers1

1

If you are picky about typography, then maybe you should use LaTeX. Gnuplot has a variety of LaTeX terminal types, such as tikz, epslatex, and cairolatex. The downside is that you must then pass the generated plot through latex or pdflatex in order to render it, so plotting is not interactive. Also, you must learn some basic LaTeX.

There is a nice tutorial on using the TikZ terminal. That page gives the following example gnuplot script (xlabel added by me):

set term tikz standalone color solid size 5in,3in
set output 'sin.tex'
set xlabel '$t_{\alpha\beta}$'
set xrange [0:2*pi]
plot sin(x) with lines
exit

Note that the exit is important, otherwise sin.tex will be incomplete. To turn this into a PDF, run pdflatex sin.tex.

You still cannot control the positioning of the subscript (well, probably LaTeX will let you do this if you are expert enough), however the defaults were chosen by typographic experts who probably have a better eye than you or me.

Dan Stahlke
  • 1,417
  • 1
  • 15
  • 20
  • Would a `set output` work in place of the exit? (Just curious) I suppose I could use LaTeX... and it might be faster anyways! I was hoping there'd be a way in Gnuplot though :-) – darthbith Jun 04 '13 at 14:50
  • According to a comment on the page I linked to, you can do `unset output` instead of `exit`. As for speed, I don't think I'd call LaTeX "fast", but I'm rather impatient. It takes about a second or two to compile a simple plot. – Dan Stahlke Jun 04 '13 at 18:40
  • I meant faster in that I'm already familiar with LaTeX and can probably gin up a solution in LaTeX (if this even needs to be fixed) faster than I can in Gnuplot – darthbith Jun 04 '13 at 19:14