#89 changeable decimal sign for input

closed-fixed
Ethan Merritt
None
5
2005-06-22
2004-11-25
M_Metze
No

Hello!

I use Gnuplot 4.0 and if i try to plot some values with
the settings:

set datafile separator ";"
set decimalsign ","

a graph will be generated, but only integer values are
drawn.
All of my nice floating point values are rounded or cut
off. :(

Settings, that seem to work, are:
(with corresponding datafile format)

separator - decimalsign
";" "."
"," "."
" " "."

Many other combinations don't work propperly:

separator - decimalsign
" " ","
";" " "
"," ";"
"," " "
"," ":"
"." ","
"." ";"
"." " "
...
Are there some "hidden" restriction to these options?
If so, the documentation should adress this limitation.

Cheers,
M. Metze

Discussion

  • Ethan Merritt
    Ethan Merritt
    2004-11-25

    Logged In: YES
    user_id=235620

    Here is what the gnuplot documentation says:

    The `set decimalsign` command selects
    a decimal sign for numbers printed into
    tic labels or `set label` strings.

    So you see that this only affects output, not input.

    Input is performed using the standard C language input
    routine scanf(). If there is any way to have this recognize
    commas as part of a floating point number, it must be at the
    system level not from inside a particular application like
    gnuplot. If you are on a modern unix/linux system, try
    setting the environmental variable LC_NUMERIC to some
    language that uses commas. Of course you must have
    previously installed the language localization packages for
    this language. More information is [maybe] available from
    "man locale".

     
  • Harald Harders
    Harald Harders
    2004-11-27

    Logged In: YES
    user_id=207272

    At the moment, the decimalsign setting applies only for
    output of numbers. I think an additional command would be
    worthwhile to change the decimal sign for the input. But you
    still should be able to change both settings seperately.

     
  • M_Metze
    M_Metze
    2004-11-29

    Logged In: YES
    user_id=1164588

    Hello,

    First of all, sorry for not reading the documentation precisely.
    Apperently i simply read over this first sentence. Anyway
    for now i have to deal with this problem on my own.
    Due to the fact, that perl scripts are creating my input
    data, i think a simple substitution of commas for dots will
    be adequate.
    Like harders stated, i would like to see a separate command
    for adjusting the input decimalsign setting, too.

    Thanx for your help!

     
    • labels: 102070 -->
    • summary: datafile separator and decimalsign issue --> changeable decimal sign for input
     
  • Logged In: YES
    user_id=27517

    Since it's agreed that this wasn't actually a bug, I'm
    moving this over to feature requests.

     
  • Ethan Merritt
    Ethan Merritt
    2005-06-22

    • assigned_to: nobody --> sfeam
    • status: open --> closed-fixed
     
  • Ethan Merritt
    Ethan Merritt
    2005-06-22

    Logged In: YES
    user_id=235620

    Support for LC_NUMERIC locale settings during input of data
    is now in the cvs version. The new command is
    set decimalsign {locale {"explicit-locale-string"}}
    If you do not specify a particular locale, it will use the
    value of LC_NUMERIC from the environment. This will set the
    decimal sign used for both input and output. If you want to
    over-ride this setting for the format of the plot itself,
    you can follow this with a call to
    set decimalsign "."