%pip install ipywidgets==8.1.3
%pip install ipympl hyperspy[gui-jupyter]
widget
backend from ipympl library)¶%matplotlib widget
import hyperspy.api as hs
dir(hs.data)
s = hs.data.two_gaussians()
s.plot()
s
m = s.create_model()
g1 = hs.model.components1D.GaussianHF()
g2 = hs.model.components1D.GaussianHF()
g1.name = "wide"
g2.name = "narrow"
m.extend([g1, g2])
m.components
m.print_current_values()
m.axes_manager.indices = (0, 0)
m.components.narrow.centre.value = 60
m.components.wide.centre.value = 50
m.fit()
m.plot()
m.multifit()
m.plot()
m.red_chisq.get_histogram().plot()
m.multifit(iterpath="serpentine")
m.plot()