01.02.2014 Views

GNUPlot Manual

GNUPlot Manual

GNUPlot Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

36 SET-SHOW gnuplot 4.0 67<br />

Tic-mark label numerical format specifiers<br />

Format Explanation<br />

%f floating point notation<br />

%e or %E exponential notation; an ”e” or ”E” before the power<br />

%g or %G the shorter of %e (or %E) and %f<br />

%x or %X hex<br />

%o or %O octal<br />

%t mantissa to base 10<br />

%l mantissa to base of current logscale<br />

%s mantissa to base of current logscale; scientific power<br />

%T power to base 10<br />

%L power to base of current logscale<br />

%S scientific power<br />

%c character replacement for scientific power<br />

%P multiple of pi<br />

A ’scientific’ power is one such that the exponent is a multiple of three. Character replacement of<br />

scientific powers ("%c") has been implemented for powers in the range -18 to +18. For numbers outside<br />

of this range the format reverts to exponential.<br />

Other acceptable modifiers (which come after the "%" but before the format specifier) are "-", which<br />

left-justifies the number; "+", which forces all numbers to be explicitly signed; "#", which places a<br />

decimal point after floats that have only zeroes following the decimal point; a positive integer, which<br />

defines the field width; "0" (the digit, not the letter) immediately preceding the field width, which<br />

indicates that leading zeroes are to be used instead of leading blanks; and a decimal point followed by<br />

a non-negative integer, which defines the precision (the minimum number of digits of an integer, or the<br />

number of digits following the decimal point of a float).<br />

Some releases of ’printf’ may not support all of these modifiers but may also support others; in case of<br />

doubt, check the appropriate documentation and then experiment.<br />

Examples:<br />

set format y "%t"; set ytics (5,10) # "5.0" and "1.0"<br />

set format y "%s"; set ytics (500,1000) # "500" and "1.0"<br />

set format y "+-12.3f"; set ytics(12345) # "+12345.000 "<br />

set format y "%.2t*10^%+03T"; set ytic(12345)# "1.23*10^+04"<br />

set format y "%s*10^{%S}"; set ytic(12345) # "12.345*10^{3}"<br />

set format y "%s %cg"; set ytic(12345) # "12.345 kg"<br />

set format y "%.0P pi"; set ytic(6.283185) # "2 pi"<br />

set format y "%.0f%%"; set ytic(50) # "50%"<br />

set log y 2; set format y ’%l’; set ytics (1,2,3)<br />

#displays "1.0", "1.0" and "1.5" (since 3 is 1.5 * 2^1)<br />

There are some problem cases that arise when numbers like 9.999 are printed with a format that requires<br />

both rounding and a power.<br />

If the data type for the axis is time/date, the format string must contain valid codes for the ’strftime’<br />

function (outside of gnuplot, type "man strftime"). See set timefmt (p. 143) for a list of the allowed<br />

input format codes.<br />

36.21.2 Time/date specifiers<br />

In time/date mode, the acceptable formats are:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!