locale.h and gnuplot
Andreas Beyer
beyer at imb-jena.de
Thu Feb 10 15:55:53 CET 2005
I think I had the same problem with StatistX. If I remember correctly,
my solution was to set the locale to the default C-locale before passing
anything to gnuplot. Afterwards I set it back to the previous setting.
Andreas
Bernhard Reiter schrieb:
> 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.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Statist-list mailing list
> Statist-list at intevation.de
> https://intevation.de/mailman/listinfo/statist-list
--
--------------------------------------
Dr. Andreas Beyer - beyer at imb-jena.de
http://www.imb-jena.de/~beyer
--------------------------------------
More information about the Statist-list
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)