<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _xdate_setter(self, xdate_format='%Y-%m-%d'):
 """Makes x axis a date axis with auto format Parameters xdate_format: String \tSets date formatting """


        if xdate_format:
            # We have to validate xdate_format. If wrong then bail out.
            try:
                self.autofmt_xdate()
                datetime.date(2000, 1, 1).strftime(xdate_format)

            except ValueError:
                self.autofmt_xdate()
                return

            self.__axes.xaxis_date()
            formatter = dates.DateFormatter(xdate_format)
            self.__axes.xaxis.set_major_formatter(formatter)