If you use reprex, the generated images will be on your clipboard in addition to the formatted code (input and output).