#637 Fix default numeric formatting to be prettier in enhanced mode

None
closed-accepted
Ethan Merritt
None
5
2014-09-05
2013-10-03
Craig DeForest
No

Gnuplot is notorious among scientists for being "ugly by default" compared to, say, R. This appears to boil down to a few minor formatting issues. The most cogent is formatting of large numbers in axis values.

Even in enhanced terminals, the current CVS produces values like "1.00000e+15" in the default formatting, while R and other packages produce much prettier axis values by default. This patch overcomes that by:

  • introducing new format specifiers -- '%h' and '%H' -- that use "x10^{exp}" and "*10^{exp}" when (and only when) used in enhanced text mode (falling back to %g/%G in non-enhanced text mode);

  • making '% h' the default axis value specifier instead of the former "% g".

Enhanced text mode is tested by looking at the flags for the current terminal. Although some text outputs have ignore_enhanced flags, those text outputs (titles and legends) do not use gprintf for their formatting, so the current mod does not have to examine those flags nor know its context in order to work.

1 Attachments

Related

Patches: #637

Discussion

<< < 1 2 (Page 2 of 2)
  • Ethan Merritt
    Ethan Merritt
    2014-02-17

    • status: pending-accepted --> closed-accepted
     
<< < 1 2 (Page 2 of 2)