In the specific case of time/date data gnuplot offers a command to treat input coordinates for a specific axis as a time measured in seconds. The most common case is time data along the x axis, for which you could specify something like
set xdata time
set timefmt "%Y-%m-%d" # Data read from the file looks like "2022-01-31"
set xtics time format "%d %b" # tics along x will look like "21 Jan"
The point is that even when you are using time-based commands, the raw numbers stored as coordinates are always in seconds. If you want to read in raw seconds, omit the set xdata time
command. The output formatting of the xaxis tic labels can still be in time units.
Conversely if for some reason you want to read data from a file that contains units of days/hours/etc but display them as seconds, you can keep the set xdata time
but change to set xtics numeric
.
Although it is less common, the equivalent commands (set ydata
, set ytics time format
, ...) work for other axes also. So you could have dates along y or x2, and so on.
As to your other specific examples, gnuplot provides formatting options for quantities in scientific notion and in computer-style units like 1024 bytes = 1 kibyte.
For a more detailed list of format options, see the documentation section format specifiers. Below is a table from that section (there is a separate documentation for time/date)
The acceptable formats (if not in time/date mode) are:
Format Explanation
%f floating point notation
%e or %E exponential notation; an "e" or "E" before the power
%g or %G the shorter of %e (or %E) and %f
%h or %H like %g with "x10^{%S}" or "*10^{%S}" instead of "e%S"
%x or %X hex
%o or %O octal
%t mantissa to base 10
%l mantissa to base of current logscale
%s mantissa to base of current logscale; scientific power
%T power to base 10
%L power to base of current logscale
%S scientific power
%c character replacement for scientific power
%b mantissa of ISO/IEC 80000 notation (ki, Mi, Gi, Ti, Pi, Ei, Zi, Yi)
%B prefix of ISO/IEC 80000 notation (ki, Mi, Gi, Ti, Pi, Ei, Zi, Yi)
%P multiple of pi
If you are having a specific problem with any of this, please modify your question to provide a few lines of data showing the format used, and a more complete description or sample of what you want the output to look like.