Weird behaviour of TPaveText in jsroot

Dear experts,

I found an interesting behavior of TPaveText when used with jsroot. Consider the following toy example of filling a TPaveText:

TPaveText *pt = new TPaveText(0.05,0.05,.95,.95);
    for(int i=0; i<3; i++){
         pt->AddText(Form("Group %d", i));

        for(int j = 0; j<2; j++){
          pt->AddText(Form("Member %d", j));

The expected output of this code is the following:

However, when using the same code with jsroot, the output looks like this:

As it can be seen, there are two issues:

  1. The placement of the TLine does not follow the expected behavior of the AddLine() function
  2. The SetTextAlign() function does not work

I would appreciate any help for this problem!


I think @linev can help.

Hello again,

In case you would like to check this issue with an already existing TPaveText on the official jsroot webpage, here is a TObject that contains a TPaveText generated with the example code above.
TObject_1653482257683.root (5 KB)

Thanks a lot in advance for any help with this!


Hi Marcel,

Thanks for providing example - it much easier to debug it.
I fix several problems with drawing of TPaveText elements - here how it works:



Hi Sergey,

Thanks a lot for this fix! This is great, now it looks as it is supposed to be.
Can you already anticipate when you will release these fixes in a new version of the jsroot?


Can be done in next week

1 Like

Finally, JSROOT release 7.1.0 with related fixes is there!

Hi Sergey,

This is really great! Thanks a lot for your efforts!


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.