|
From: Ethan A M. <merritt@u.washington.edu> - 2008-07-29 16:43:51
|
On Tuesday 29 July 2008, Theo Hopman wrote:
> Hi all. Why does `set format y "%5f"` not work like `set format y
> "%5g"`? I'm dealing with numbers between 0 and 5, so I would expect both
> to produce tic labels with right justified floating point numbers in a
> field of five characters, with no trailing zeros. %5g does, but %5f
> doesn't: it produces tic labels with six decimal places and trailing zeros.
That is the C standard.
From "man sprintf"
f,F The double argument is rounded and converted to decimal notation in the style
[-]ddd.ddd, where the number of digits after the decimal-point character is
equal to the precision specification. If the precision is missing, it is
taken as 6; if the precision is explicitly zero, no decimal-point character
appears. If a decimal point appears, at least one digit appears before it.
> I've tried 4.2.3 and the latest CVS on Cygwin, and 4.3.0 (dated February
> 2008) on Linux.
>
> Minimal example:
>
> reset
> plot x
> set format y "%5g"
> replot
> set format y "%5f"
> replot
>
> According to my interpretation of the documentation, the last two plots
> should be identical.
>
> THeo
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|