Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#327 minus symbols on axis labels

closed-rejected
nobody
None
5
2012-06-29
2012-04-25
Ryo
No

I wish gnuplot printed minus symbols on the axes in place of hyphens. Currently, negative numbers are printed with hyphens; e.g., "-100", which is not beautiful and looks unprofessional. If it's not easy to implement for all terminals, at least it would be nice to see an extension to "set format" that would allow the user to use the proper minus symbol for the PostScript terminal. For example,

set format x minussymbol "{/Symbol \OOO}"

where \OOO is the code of the minus symbol. There may be a better solution.

Discussion

  • Ethan Merritt
    Ethan Merritt
    2012-05-18

    • status: open --> closed-rejected
     
  • Ethan Merritt
    Ethan Merritt
    2012-05-18

    Formatting is done using the standard C library routines, so I think anything of this sort would have to be done at the level of clib.

     
  • Ethan Merritt
    Ethan Merritt
    2012-06-07

    Here is a PostScript-specific answer to your quest.

    gnuplot> set encoding iso_8859_15 # or some other encoding
    gnuplot> set term post font "Times"
    gnuplot> set output 'whatever.ps'
    ... plot commands

    In the Prolog of your PostScript output file whatever.ps is
    an encoding table that looks like this:

    /ISOLatin15Encoding [
    /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
    /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
    /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
    /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
    /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright
    /parenleft/parenright/asterisk/plus/comma/minus/period/slash
    /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon
    /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N
    /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright
    /asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m
    /n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde
    /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
    /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
    /.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve
    /dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut
    /ogonek/caron/space/exclamdown/cent/sterling/Euro/yen/Scaron
    /section/scaron/copyright/ordfeminine/guillemotleft/logicalnot
    /hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior
    /Zcaron/mu/paragraph/periodcentered/zcaron/onesuperior/ordmasculine
    /guillemotright/OE/oe/Ydieresis/questiondown
    /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
    /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
    /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
    /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute
    /Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis
    /aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave
    /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex
    /otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis
    /yacute/thorn/ydieresis
    ] def
    /Times reencodeISO15 def

    Edit the 6th line of this encoding table to replace "minus" with "endash".
    Done.

    All the minus signs in your PostScript file will now be printed using
    en dash rather than hyphen/minus. If you want to make this change
    permanently, you can edit the master copy of the encoding files in
    the shared directory /usr/local/share/gnuplot/VERSION/PostScript/

    Let me know if you like it.
    We could add it to the FAQ if you think it's generally useful.

    cheers,
    
        Ethan
    
     
  • Ethan Merritt
    Ethan Merritt
    2012-06-07

    • status: closed-rejected --> open-rejected
     
  • Ethan Merritt
    Ethan Merritt
    2012-06-29

    Offline discussion established that "set encoding ..." already provides the requested remapping for PostScript output.

     
  • Ethan Merritt
    Ethan Merritt
    2012-06-29

    • status: open-rejected --> closed-rejected