<|file_name|>minimal_example.py<|end_file_name|><｜fim▁begin｜>""" Loads hyperspy as a regular python library, creates a spectrum with random numbers and plots it to a file"""<｜fim▁hole｜>
s = hs.signals.Spectrum(np.random.rand(1024))
s.plot()

plt.savefig("testSpectrum.png")<｜fim▁end｜>

import hyperspy.api as hs
import numpy as np
import matplotlib.pyplot as plt