Skip to content

Commit

Permalink
Bugfix/fix example script (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagerber48 authored Sep 5, 2023
2 parents 9c7e8ce + 78f449b commit a72b6b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^

Expand Down
7 changes: 4 additions & 3 deletions examples/fit_plot_with_sciform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit a72b6b3

Please sign in to comment.