<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def size(self):
 """ Returns the actual size in pixels as set by matplotlib, or the user provided size if available. """

        if not hasattr(self, "_size") or self._size is None:
            fig = plt.gcf()
            self._size = fig.get_size_inches()*fig.dpi
        return self._size