Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot: how to use a*(10^b) format on axis

I am using really big numbers (milions) on my x-axis, so when I use

set format x %6.0f 

I got big numbers like 25000000. That is quite nice, but takes much space, so there are only few labels and reader losts information.

When I exclude setting format, I get something like 2e+07, what is quite unfriendly and unusual to reader according to my opinion.

I would like format like 25*(10^6), so the number would be first and then multiplied by 10^n, or something very similiar to that. I think that would be the best solution, if the x-axis is long about 30000000 points or even more.

However, reading manuals, e.g. "How do I change the format of the numbers ?" from http://t16web.lanl.gov/Kawano/gnuplot/tics-e.html did not help me much.

Thank you in advance.

like image 242
Perlnika Avatar asked Nov 03 '11 12:11

Perlnika


2 Answers

All format specifiers that gnuplot has to offer can be found here.

If you don't like the 2e+07 format you could try setting the format with

set format x "%.0s*10^{%T}" 

which gives you a format like 15*10^6.

like image 180
Woltan Avatar answered Oct 26 '22 08:10

Woltan


Also one can use the following to obtain scientific notation with cross symbol: 2x10^6

set format x "%2.0t{/Symbol \264}10^{%L}"

like image 31
sri Avatar answered Oct 26 '22 10:10

sri