0

I cannot find how to make 1234567 to 1 234 567. Found only:

set decimalsign locale "fr_FR.utf8"

set format y "%'.0f"

But it shows nonsense:

result

1

set decimalsign locale "fr_FR.utf8"

set format y "%'.0f"

vimuth
  • 5,064
  • 33
  • 79
  • 116
Pragmas
  • 1
  • 1
  • Welcome to StackOverflow! I assume you are working under Linux? Have you checked this? https://stackoverflow.com/q/22328334/7295599 I cannot test, but I would try `set decimalsign locale "french"` and `set format y "%' 0f"` – theozh Mar 05 '23 at 11:13
  • Y, I tried: gnuplot> set decimalsign locale "french" ^ line 0: Could not find requested locale – Pragmas Mar 05 '23 at 16:10

1 Answers1

0

The gnuplot commands you show should work, and in fact they do work correctly on my setup. I suspect that the problem is not gnuplot per se, but the output device you are viewing the plot on. The garbage-looking sequence â Ż is likely a failure to handle the UTF-8 byte sequence representing unicode U+2006 "SIX-PER-EM SPACE" a.k.a "THIN SPACE". So my guess is that your gnuplot script is correct but something else in your environment needs to be set to UTF-8.

It might help to tell gnuplot set encoding utf8, but from the output you show I think gnuplot is already producing utf8 that isn't handled correctly afterwards.

gnuplot> set decimalsign locale "fr_FR.utf8"
         decimal_sign in locale is ,
gnuplot> set format y "%'.0f"
gnuplot> set xrange [1.e8:1.e9]
gnuplot> set tics scale 0
gnuplot> set term dumb
gnuplot> plot x

 1 100 000 000 +-----------------------------------------------------------+   
              |                                                           |   
 1 000 000 000 |                                                 x ********|   
              |                                                      **** |   
   900 000 000 |                                                   ****    |   
              |                                               *****       |   
   800 000 000 |                                            ****           |   
              |                                         ****              |   
   700 000 000 |                                      ***                  |   
              |                                  ****                     |   
   600 000 000 |                               ****                        |   
              |                           *****                           |   
   500 000 000 |                        ****                               |   
              |                     ****                                  |   
   400 000 000 |                  ***                                      |   
              |              ****                                         |   
   300 000 000 |           ****                                            |   
              |       *****                                               |   
   200 000 000 |    ****                                                   |   
              | ****                                                      |   
   100 000 000 +--8------8-----8------8------8-----8------8------8-----8---+  9 
             1×10   2×10  3×10   4×10   5×10  6×10   7×10   8×10  9×10   1×10  
Ethan
  • 13,715
  • 2
  • 12
  • 21
  • Well, this is strange. When I try it in Gnulot command line, it looks nice. But in bash script nope. Locale is: $ locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= So I don't understand. – Pragmas Mar 05 '23 at 19:14