Jupyter Slides - How do I have a function that creates new slides?

I have a function dplots(x) that loops through a nested for loop and creates several plots (using matplotlib) when running. I usually save these plots as png images on my computer and then copy and paste them to a powerpoint but it becomes tedious. How do I add this into jupyter slides and be able to have two images on each slide, stop and create a new slide until all images have posted?