From 41fc69d6a93133ee9f4ad02193d5dae385005b5b Mon Sep 17 00:00:00 2001 From: Ewan Sutherland <66920882+The-Inky@users.noreply.github.com> Date: Wed, 10 Mar 2021 20:56:20 +0000 Subject: [PATCH] Backport PR #19665: Changed FormatStrFormatter documentation to include how to get unicode minus --- lib/matplotlib/ticker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 354e3db880b4..430d6112780b 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -411,6 +411,10 @@ class FormatStrFormatter(Formatter): The format string should have a single variable format (%) in it. It will be applied to the value (not the position) of the tick. + + Negative numeric values will use a dash not a unicode minus, + use mathtext to get a unicode minus by wrappping the format specifier + with $ (e.g. "$%g$"). """ def __init__(self, fmt): self.fmt = fmt