Skip to content

Commit

Permalink
now use ExpFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
jagerber48 committed Sep 5, 2023
1 parent 9c7e8ce commit 83a8750
Showing 1 changed file with 4 additions and 3 deletions.
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 83a8750

Please sign in to comment.