I guess this is not a major issue, but it is an annoyance that I have
not been able to find a work-around for yet:
When I have tabs (\t) in xlabels, titles, etc. in a gnuplot script, the
tabs appear in the image as the two letters N and L, with the N above
the L, when I use pgnuplot.exe on Windows to run the script. The tabs
work fine (i.e. they show as whitespace) when I run the same scripts
using gnuplot on a unix platform.
Has anyone seen this before? Is there a work-around, or am I doing
something wrong?
I tried using different character sets, but to no avail. I guess I
could do without tab-support on Windows, but I would really like my
scripts to be portable, and the tabs make the result look better in
some cases.
Here are some details:
I use Gnuplot version 4.0 patchlevel 0 on both platforms (Windows XP
Professional SP2 and Solaris 10), and the png terminal.
Here's the contents of a test script:
## This is a GnuPlot 4.0 test script
set title "Test graph\n1\ttab\n\n"
set ylabel "Test metric"
set yrange [0:*]
set data style linespoints
set key below box
set xdata time
set xlabel "Duration\t Hours:Minutes\n \tDays + 1"
set timefmt x "%j_%H:%M"
set xrange [*:*]
set format x "%H:%M\n%j"
set xtics "1_00:00", 43200 # One major tick (and label) every 12
hrs
set grid xtics
set term png # size 640x480 is default
set out "test.png"
plot "output-test.dat" using 2:4 title "Test" with lines
> When I have tabs (\t) in xlabels, titles, etc. in a gnuplot script, the
> tabs appear in the image as the two letters N and L, with the N above
> the L, when I use pgnuplot.exe on Windows to run the script.
You shouldn't (have to) use pgnuplot.exe to run scripts. pgnuplot is for
piping commands into gnuplot. For ordinary batch usage, just
wgnuplot script.plt
should do just fine.
> Has anyone seen this before? Is there a work-around, or am I doing
> something wrong?
It's at least questionable to expect a text terminal control character
like TAB to work in an environment like that of a graphic generated by
gnuplot. If you want white space, I would suggest you use blanks
instead.
> I use Gnuplot version 4.0 patchlevel 0 on both platforms (Windows XP
> Professional SP2 and Solaris 10), and the png terminal.
And you're sure it's the same PNG terminal being used on both? Please
check 'show version long' output to be sure.
--
Hans-Bernhard Broeker (bro...@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
> You shouldn't (have to) use pgnuplot.exe to run scripts. pgnuplot is for
> piping commands into gnuplot. For ordinary batch usage, just
>
> wgnuplot script.plt
>
> should do just fine.
OK, thanks for the clarification!
(There was no difference in the resulting image, though.)
> It's at least questionable to expect a text terminal control character
> like TAB to work in an environment like that of a graphic generated by
> gnuplot. If you want white space, I would suggest you use blanks
> instead.
I kindof agree, but using tabs and newlines is quite convenient
sometimes... ;) While newlines (\n) work with (my) wgnuplot, tabs (\t)
don't.
> > I use Gnuplot version 4.0 patchlevel 0 on both platforms (Windows XP
> > Professional SP2 and Solaris 10), and the png terminal.
>
> And you're sure it's the same PNG terminal being used on both? Please
> check 'show version long' output to be sure.
No, I am not at all sure... What is 'show version long' supposed to
tell me? The only difference I see with regards to PNG is that the
windows version has the compile options
"+READLINE -LIBREADLINE +GD_PNG +GD_GIF -PNG -NOCWDRC +USE_MOUSE"
and the Solaris version has the compile options
"+READLINE -LIBREADLINE -LIBGD +PNG -NOCWDRC +X11 +USE_MOUSE"
I see there is a difference, and that it probably has something to do
with the gd library. I have not investigated what this really means,
but I guess you already know... ;)
When I do a 'set term' in Gnuplot, the Windows version says
"png PNG images using libgd and TrueType fonts"
while the Solaris version says
"png Portable Network Graphics [small medium large] [monochrome gray
color]"
with regards to the png terminal.
> Hans-Bernhard Broeker wrote:
> > It's at least questionable to expect a text terminal control character
> > like TAB to work in an environment like that of a graphic generated by
> > gnuplot. If you want white space, I would suggest you use blanks
> > instead.
> I kindof agree, but using tabs and newlines is quite convenient
> sometimes... ;) While newlines (\n) work with (my) wgnuplot, tabs (\t)
> don't.
Newlines work because they're explicitly supported by the program.
Basically, a "\n" breaks up a text label into two individual ones,
each output separately. There's no such special-case support for
tabs, so you get whatever the terminal driver and/or the underlying
platform happens to do if you tell it to print the TAB character.
> No, I am not at all sure... What is 'show version long' supposed to
> tell me? The only difference I see with regards to PNG is that the
> windows version has the compile options
> "+READLINE -LIBREADLINE +GD_PNG +GD_GIF -PNG -NOCWDRC +USE_MOUSE"
> and the Solaris version has the compile options
> "+READLINE -LIBREADLINE -LIBGD +PNG -NOCWDRC +X11 +USE_MOUSE"
That's *exactly* the crucial difference. It means that the PNG output
is being generated by two almost completely independent code paths,
using different fonts. The Windows binary has the GD-based PNG
driver, the Solaris one has the old-style driver. The output you get
from printing a TAB is only one small detail in the collection of
differences that causes.
OK, I'm quite new to Gnuplot, so my knowledge is not at that level of
detail yet ;) I erroneously assumed that tabs would work because
newlines worked. I'll try to avoid tabs from now on.
> > No, I am not at all sure... What is 'show version long' supposed to
> > tell me? The only difference I see with regards to PNG is that the
> > windows version has the compile options
>
> > "+READLINE -LIBREADLINE +GD_PNG +GD_GIF -PNG -NOCWDRC +USE_MOUSE"
>
> > and the Solaris version has the compile options
>
> > "+READLINE -LIBREADLINE -LIBGD +PNG -NOCWDRC +X11 +USE_MOUSE"
>
> That's *exactly* the crucial difference. It means that the PNG output
> is being generated by two almost completely independent code paths,
> using different fonts. The Windows binary has the GD-based PNG
> driver, the Solaris one has the old-style driver. The output you get
> from printing a TAB is only one small detail in the collection of
> differences that causes.
I see. By combining this information with the information in the
README.1ST file that came with the binary distribution, I now
understand a lot more of what was going on.
Thanks!
--
Embo