def scale_axes_from_data(self):
<EOL>if self.args.xmin is None:<EOL><INDENT>self.args.xmin = min(fs.xspan[<NUM_LIT:0>] for fs in self.spectra)<EOL><DEDENT>if self.args.xmax is None:<EOL><INDENT>self.args.xmax = max(fs.xspan[<NUM_LIT:1>] for fs in self.spectra)<EOL><DEDENT>cropped = [fs.crop(self.args.xmin, self.args.xmax) for<EOL>fs in self.spectra]<EOL>ymin = min(fs.value.min() for fs in cropped)<EOL>ymax = max(fs.value.max() for fs in cropped)<EOL>self.plot.gca().yaxis.set_data_interval(ymin, ymax, ignore=True)<EOL>self.plot.gca().autoscale_view(scalex=False)<EOL>
Restrict data limits for Y-axis based on what you can see