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

Perlnika picture Perlnika · Nov 3, 2011 · Viewed 46k times · Source

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.

Answer

Woltan picture Woltan · Nov 3, 2011

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.