From a899051a51090ed354b7b8e66dcf26236b8b732d Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 25 Apr 2024 10:52:01 +0200 Subject: [PATCH] Appease pycodestyle. The ":d" conversion in polar.py (which confuses pycodestyle due to the nested f-string) is unnecessary as digits is made an int immediately above. While at it, also remove the comment above, which is just wrong as all supported mathtext fonts support `\circ` (but unicode still seems to be the better option). --- lib/matplotlib/backends/backend_ps.py | 3 +-- lib/matplotlib/projections/polar.py | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index d760bef04d19..5f224f38af1e 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -362,8 +362,7 @@ def create_hatch(self, hatch): /PaintProc {{ pop {linewidth:g} setlinewidth -{self._convert_path( - Path.hatch(hatch), Affine2D().scale(sidelen), simplify=False)} +{self._convert_path(Path.hatch(hatch), Affine2D().scale(sidelen), simplify=False)} gsave fill grestore diff --git a/lib/matplotlib/projections/polar.py b/lib/matplotlib/projections/polar.py index 6bd72d2e35e0..8d3e03f64e7c 100644 --- a/lib/matplotlib/projections/polar.py +++ b/lib/matplotlib/projections/polar.py @@ -270,11 +270,7 @@ def __call__(self, x, pos=None): vmin, vmax = self.axis.get_view_interval() d = np.rad2deg(abs(vmax - vmin)) digits = max(-int(np.log10(d) - 1.5), 0) - # Use Unicode rather than mathtext with \circ, so that it will work - # correctly with any arbitrary font (assuming it has a degree sign), - # whereas $5\circ$ will only work correctly with one of the supported - # math fonts (Computer Modern and STIX). - return f"{np.rad2deg(x):0.{digits:d}f}\N{DEGREE SIGN}" + return f"{np.rad2deg(x):0.{digits}f}\N{DEGREE SIGN}" class _AxisWrapper: