All projects

Upstream commits

matplotlib

matplotlib/matplotlib

View on GitHub

2 commits

  1. Use _format_maybe_minus_and_locale for the EngFormatter mantissa
    Reuse the ScalarFormatter helper instead of duplicating the locale and mathtext comma escaping. As a side effect, format_data now applies axes.unicode_minus to the mantissa, as ScalarFormatter.format_data already does; __call__ and get_offset applied it already.
  2. FIX: make EngFormatter respect axes.formatter.use_locale rcParam
    EngFormatter subclasses ScalarFormatter, but the inherited locale machinery is reachable only in the offset path. The normal engineering formatting path both forces the flag off at construction, by passing useLocale=False to super().__init__, and bypasses locale-aware formatting, by interpolating the mantissa directly. The rcParam therefore had no effect, and set_useLocale flipped a flag that format_data never consulted. Pass useLocale through to ScalarFormatter and add the matching keyword argument, so that the rcParam applies and an explicit value overrides it. When locale formatting is on, the mantissa goes through locale.format_string, and the separators it introduces are escaped for mathtext the same way ScalarFormatter already escapes them.

Updated daily, last on 2026-11-16. By Christian Aurich Zanettini Martins · All projects