1

Does something like tiny space exist in gnuplot? I searching for something similar to, for instance, , in LaTeX.

set xlabel "2\,400\,000" 
Elena Greg
  • 1,061
  • 1
  • 11
  • 26
  • Not that I currently know of. If you absolutely need it, can't you use a LaTeX terminal, e.g. cairolatex or tikz? – theozh Sep 28 '22 at 06:17

2 Answers2

2

Unicode provides two options roughly equivalent to LaTeX \thinspace

U+2009   THIN SPACE              UTF-8: 0xE2 0x80 0x89
U+202F   NARROW NO-BREAK SPACE   UTF-8: 0xE2 0x80 0xAF

and another that may or may not be slightly smaller than that

U+2008  PUNCTUATION SPACE       UTF-8: 0xE2 0x80 0x88

You could copy-paste the utf-8 sequence directly into gnuplot but obviously it will be hard to see whether it worked or not :-) It is probably better to provide the unicode value as an escape sequence. Of course this only works if you are using a font that supports the unicode code point being used; otherwise it will probably substitute a normal space. It might also be sensitive to quirks in the various graphics libraries; for example I had better luck using the wxt terminal than I did with nominally the same font using the qt terminal.

set term wxt font "Arial,15"
set label 1 at graph 0.1,0.9 "2400000"
set label 2 at graph 0.1,0.8 "2{\U+2009}400{\U+2009}000"
set label 3 at graph 0.1,0.7 "2 400 000"
set label 4 at graph 0.1,0.6 "2{\U+202F}400{\U+202F}000"

plot x

enter image description here

Ethan
  • 13,715
  • 2
  • 12
  • 21
1

Well, here is an awkward workaround without using a LaTeX terminal, but using enhanced text (check help enhanced).

I assume you want a thousand separator. If you are working under Linux, the following might be of interest: gnuplot: How to enable thousand separators (digit grouping)?

Script:

### small space between numbers
reset session

set termoption font "Arial,18"

set label 1 at graph 0.1,0.9 "2400000"
set label 2 at graph 0.1,0.8 "~2{.0}~ {.0 }40~0{.0}~ {.0 }000"
set label 3 at graph 0.1,0.7 "2 400 000"

plot x
### end of script

Result: (from wxt terminal under Windows)

enter image description here

theozh
  • 22,244
  • 5
  • 28
  • 72