<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply_rcparams(self):
 """ Set the rcParams """

        from matplotlib import rcParams
        for key, val in self.rcParams.items():
            try:
                rcParams[key] = val
            except Exception as e:
                msg = ("""Setting "mpl.rcParams['{}']={}" """
                       "raised an Exception: {}")
                raise PlotnineError(msg.format(key, val, e))