<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_longitude_grid(self, degrees):
 """ Set the number of degrees between each longitude grid. """

        number = (360.0 / degrees) + 1
        locs = np.linspace(-np.pi, np.pi, number, True)[1:]
        locs[-1] -= 0.01 # Workaround for "back" gridlines showing.
        self.xaxis.set_major_locator(FixedLocator(locs))
        self._logitude_degrees = degrees
        self.xaxis.set_major_formatter(self.ThetaFormatter(degrees))