I want my histogram to remain in the screen

I want my histogram to remain on the screen but when I delete the dynamics memory of it, so its disappears so whats the good option that I got my plot and also delete the dynamic allocated memories as well or does root do itself when I cross the canvas.


Bear with my guessing (not a lot of context is being shared here), but I think what you are after is either a delayed deletion of your drawn entities, such as histograms, or the method ::DrawClone.

I hope this helps.