From 64b7bae997950428605eb0736ed9237f3d58f7c7 Mon Sep 17 00:00:00 2001 From: vivarose Date: Fri, 7 Nov 2025 02:26:08 -0500 Subject: [PATCH 1/2] fix(plot): correctly render mu Close #678 correctly render mu symbol in plot labels --- trackpy/plots.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/trackpy/plots.py b/trackpy/plots.py index 685e0aa5..77bae863 100644 --- a/trackpy/plots.py +++ b/trackpy/plots.py @@ -317,10 +317,7 @@ def plot_traj(traj, colorby='particle', mpp=None, label=False, _set_labels(ax, '{} [px]', pos_columns) mpp = 1. # for computations of image extent below else: - if mpl.rcParams['text.usetex']: - _set_labels(ax, r'{} [\textmu m]', pos_columns) - else: - _set_labels(ax, r'{} [\xb5m]', pos_columns) + _set_labels(ax, r'{} [$\mu$m]', pos_columns) # Background image if superimpose is not None: ax.imshow(superimpose, cmap=plt.cm.gray, From e9fad1cb63a4e54483ec807ad9b69fa969d40046 Mon Sep 17 00:00:00 2001 From: vivarose Date: Fri, 6 Mar 2026 01:00:06 -0500 Subject: [PATCH 2/2] Make \mu upright @T0T0R was right --- trackpy/plots.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trackpy/plots.py b/trackpy/plots.py index 77bae863..c2e5b6aa 100644 --- a/trackpy/plots.py +++ b/trackpy/plots.py @@ -224,7 +224,7 @@ def scatter(centroids, mpp=None, cmap=None, ax=None, pos_columns=None, if mpl.rcParams['text.usetex']: _set_labels(ax, r'{} [\textmu m]', pos_columns) else: - _set_labels(ax, r'{} [\xb5m]', pos_columns) + _set_labels(ax, '{} [\xb5m]', pos_columns) _plot(ax, centroids, pos_columns, **_plot_style) return invert_yaxis(ax) @@ -317,7 +317,10 @@ def plot_traj(traj, colorby='particle', mpp=None, label=False, _set_labels(ax, '{} [px]', pos_columns) mpp = 1. # for computations of image extent below else: - _set_labels(ax, r'{} [$\mu$m]', pos_columns) + if mpl.rcParams['text.usetex']: + _set_labels(ax, r'{} [\textmu m]', pos_columns) + else: + _set_labels(ax, '{} [\xb5m]', pos_columns) # Background image if superimpose is not None: ax.imshow(superimpose, cmap=plt.cm.gray,