Size of a graph inside a Pad

Good Morning,

I am plotting some LEGO graphs where the color scale is in the right side of the pad (see attachment). The problem is that the graph is so big inside the pad that the scale is almost outside of it. In consequence one cannot read the numbers of the scale.

I just need to rearrange a bit the elements inside the pad so that it looks a bit prettier. Is it possible to define the size and position of the graph inside the pad, so that it leaves more space for the scale?

Thanks,
Estela.


You can change the Canvas right margin (root.cern.ch/root/html/TAttPad.h … ightMargin):

c1->SetRightMargin(0.15);

Thanks a lot, this solves my problem.

Just to know it for the future: is it possible to change the size of the palette scale, or is it fixed?

The attached example does it.
movepal.C (2.42 KB)

Hi,

I copied the couple of sentences that I need to re-size the palette scale:

c1->Update(); t1 -> Draw("Rrow:Rcolumn>>h1","","LEGO2Z"); TPaletteAxis *palette = (TPaletteAxis*)h1->GetListOfFunctions()->FindObject("palette"); palette->SetX1NDC(0.9); palette->SetX2NDC(0.95); palette->SetY1NDC(0.2); palette->SetY2NDC(0.8); h1 ->GetXaxis()->SetTitle("Column"); h1 ->GetXaxis()->SetTitleOffset(2.0); h1 ->GetYaxis()->SetTitle("Row"); h1 ->GetYaxis()->SetTitleOffset(2.0); c1->Modified(); c1->Update();

But I get a segmentation violation:

*** Break *** segmentation violation (no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". Attaching to program: /proc/6947/exe, process 6947 (no debugging symbols found)...done. (no debugging symbols found)...done. (no debugging symbols found)...done. (no debugging symbols found)...done. [Thread debugging using libthread_db enabled] [New Thread -1208084784 (LWP 6947)] (no debugging symbols found)...done. . . ... and so on...

Any idea of what could be the reason?

Estela.

you forgot:

myCanvas->Update();

before:

TPaletteAxis *palette = (TPaletteAx…

VERY IMPORTANT !

Thank you very much!

Now the graphs look very nice.

Nice afternoon,
Estela.