An already drawn canvas/pad as sub-pad of another canvas


can someone give me a recipe, how I can set an already drawn canvas as a sub-pad of another canvas?

The situation is this:
I draw four very complicated histrogramms on four canvases. I want to save each individual canvas to a file and I also want to compose them into a new canvas, which is divided into four sub-pads.

I can do this now:
Draw each histogramm individually, save individually, make new canvas, divded canvas, draw each histogramm again on different sub-pad and save the composition.

I want to avoid drawing the histogramms twice, so I tried this:
Create a “big” canvas, divide into sub-pads, draw each histogramm on a sub-pad and save the sub-pad, in the end save the “big” canvas (as the composition). The problem is, that the sub-pad files came out wrong, i.e. the plot was not on the whole page, but in some corner of the page (according to the position of the sub-pad on the “big” canvas, although I saved the sub-pad).

I probably don’t understand the relation between canvas and sub-pad correctly, so what is the correct procedure?

Thanks Duc

Use the context menu “DrawClonePad” when your mouse points to the
source canvas. This will paint all the primitives in the pad where you have the mouse to the current pad (you can set the current pad by clicking
on it with the middle mouse button).
You can create the empty destination pad with the canvas menu (activate the ToolBar" in the “View” menu.
All what you do with the mouse can also be done from the command (or C++) side.



thank you for your quick reply. I tried the DrawCloneMethod and it works, but when I want to clone a canvas which has more than two histogramms (drawn with “same” option). Only the last histogramm is transferred to the new canvas.

Is this a bug? (I tested v5.12 and v5.13)


Use DrawClonePad, not DrawClone


Sorry, this was a typo, I used DrawClonePad.