def autoscale(self):
dmin, dmax = self.datalim_to_dt()<EOL>if dmin > dmax:<EOL><INDENT>dmax, dmin = dmin, dmax<EOL><DEDENT>dmin, dmax = self.datalim_to_dt()<EOL>vmin = dates.date2num(dmin)<EOL>vmax = dates.date2num(dmax)<EOL>return self.nonsingular(vmin, vmax)<EOL>
Set the view limits to include the data range.