Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commas in gnuplot labels

I'm plottng monetary data with gnuplot and currently I've managed to set the labels on the y axis to be floating point values with no decimals (rather than exponentials) but I want to be able to add comma's to the label but I cant figure out how.

Any ideas?

i.e. The current output gives me £25000000 - as you can see, the data isn't grouped - I want to split it in thousands so it appears as £25,000,000.

EDIT: My current setting is

set format y '£%.0f'

like image 447
drezha Avatar asked Oct 27 '11 13:10

drezha


1 Answers

As stated here the thousands separator depends on the locale-specific formatting.
If this setting allows for the thousands separator it will be printed with:

set decimal locale
set format y "%'g"
plot 1000*x

An other option would be to set the ytics manually (see here) like so:

set ytics ("5,000,000" 5000000, "10,000,000" 10000000, "15,000,000" 15000000, "20,000,000" 20000000, "25,000,000" 25000000)
plot[0:3] 10000000*x
like image 76
Woltan Avatar answered Sep 30 '22 09:09

Woltan