From 83a87502e2300e9848819b1bdae73277d56d7422 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 5 Sep 2023 06:21:10 -0600 Subject: [PATCH 1/2] now use ExpFormat --- examples/fit_plot_with_sciform.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/fit_plot_with_sciform.py b/examples/fit_plot_with_sciform.py index 0b04756d..493d480c 100644 --- a/examples/fit_plot_with_sciform.py +++ b/examples/fit_plot_with_sciform.py @@ -7,7 +7,8 @@ from scipy.optimize import curve_fit from tabulate import tabulate -from sciform import Formatter, ExpMode, RoundMode, SignMode, FormatOptions +from sciform import (Formatter, ExpMode, RoundMode, SignMode, FormatOptions, + ExpFormat) def get_scale_and_offset_from_offset_str( @@ -54,11 +55,11 @@ def prefix_exp_ticks(ax: plt.Axes, axis: Literal['x', 'y'], exp_mode = ExpMode.ENGINEERING_SHIFTED tick_formatter = Formatter(FormatOptions( exp_mode=exp_mode, - prefix_exp=True)) + exp_format=ExpFormat.PREFIX)) offset_formatter = Formatter(FormatOptions( sign_mode=SignMode.ALWAYS, exp_mode=exp_mode, - prefix_exp=True)) + exp_format=ExpFormat.PREFIX)) ax.ticklabel_format(axis=axis, style='sci') From 78f449b6f3ad1755b4111c8f170023e5a1a60f3c Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 5 Sep 2023 06:23:51 -0600 Subject: [PATCH 2/2] changelog --- CHANGELOG.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 80ed9dc7..d97009dd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -23,6 +23,12 @@ Changed or ``b+02`` is used to indicate the exponent then the value and uncertainty are always wrapped in parentheses. +Fixed +^^^^^ + +* Correct ``fit_plot_with_sciform.py`` example script to use new + ``exp_format=ExpFormat.PREFIX`` instead of old ``prefix_exp=True``. + Improved ^^^^^^^^