Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Gnuplot use the "unicode minus" sign for negative numbers

Gnuplot uses the hyphen-minus sign (U+002D) when it prints negative numbers (e.g., tick labels). I would like to make Gnuplot use the unicode minus sign (U+2212).

Usually, I have relied on one of the following workarounds:

  1. Explicitly set the label of each tick mark using set xtics (-0.05 "−0.05", ...);
  2. Export the plot using a LaTeX driver (e.g., epslatex) and enclose the number within $$ (e.g., set format x "$%.2f$").

However, none of the above solution appeals me. Is there any way to make Gnuplot automatically use the correct typographical convention for negative numbers?

like image 945
Maurizio Tomasi Avatar asked Jan 26 '15 15:01

Maurizio Tomasi


People also ask

How does a minus sign or hyphen(-) function?

The minus sign (−) is used with numbers to indicate negative amounts or as the symbol for the subtraction operation. The hyphen (‐) is used to link together different parts of a word (e.g. “ex‐wife”, “field-artillery”) or as a sign to indicate that the rest of a word is on the next line.

Is minus a hyphen or en dash?

The name "hyphen-minus" derives from the original ASCII standard, where it was called "hyphen (minus)". The character is referred to as a "hyphen", a "minus sign", or a "dash" according to the context where it is being used.

Are minus and dash the same?

The minus and hyphen sign are the same thing. A hyphen is a short, single-character line which connects word parts (i.e. ice-cream). A dash is a longer line—double the length of a hyphen—which indicates a break or an interruption in the thought.


1 Answers

Since version 5.0.5 gnuplot has a set minussign command. When this is set, the gprintf function, which is also used to set the tics labels, uses typographic minus signs (U+2212) instead of a hyphen:

set encoding utf8
set minussign
plot x

enter image description here

like image 182
Christoph Avatar answered Sep 21 '22 13:09

Christoph