locale.h and gnuplot

Bernhard Reiter bernhard at intevation.de
Thu Feb 10 13:45:24 CET 2005


On Thu, Feb 10, 2005 at 09:37:47AM -0300, Jakson Aquino wrote:
> When trying to see a boxplot I got the following
> gnuplot error:
> 
> Spalte fuer Variable 1: TVHOURS
> 
> Erstelle gnuplot-Graphik ...
> 
> 
> 0 vermutliche Ausreisser gefunden
> 
>    --- Bitte mit ENTER fortfahren ... ---
> gnuplot> plot [0,8:5,2][9:13]
> '/home/jakson/stat_gpl.dat' with lines
>                 ^
>          line 0: ':' or keyword 'to' expected
> 
> 
> The problem is that, in many languages (among them:
> German, French, Spanish, Italian, and Portuguese), the
> decimal separator is not a "."; it's a ",". However,
> the culprit is <locale.h>. With locale.h, the printf
> function becomes very smart. It's good to see the
> results of calculations printed with the correct
> decimal separator, but, while writing a file to
> gnuplot, locale.h is a problem.
> 
> Another --far less important-- side effect of locale.h
> is that if we save columns in an ascii file running
> Statist in a language other than English, it will not
> be possible to open the file running Statist in
> English. We would have, for example, 1,30000e+01
> instead of 1.30000e+01. Since this side effect isn't
> properly a bug of Statist, I think that it will be
> enough to document it. And the solution is very
> simple: use some tool to replace all "," with ".".
> 
> Is there any easy way of fixing the problem with
> gnuplot?

We probably need to ignore 
the locale settings for files and gnuplot.
This is possible, I only have to look up how.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/statist-list/attachments/20050210/099416eb/attachment.bin


More information about the Statist-list mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)