Drawing with "CONT3SAME" does not update list of contours

This is likely to be a bug report, but thought I’d confirm first.

When drawing a TH2 with CONTLIST it is possible to do

canvas->Update();
gROOT->GetListOfSpecials()->FindObject("contours");

However this does not work (returns nullptr) when drawing with option CONT3SAMELIST.

Presumably this is a bug. Is there a possible workaround for this, since I need to be able to draw these contours with “CONT3” before creating another histogram, using the x,y coordinates of the contours.

Fixing the bug in the next ROOT release is great but there is no easy way for me to get that update with the software distribution I am required to use by my software team.

Hi,

Now “LIST” option only supported for plain “CONT” draw option, any other are excluded.
Potentially, it can be done - you are welcome to submit issue on github. Also your previous problem with CONT can be submitted as separate issue.

Regards,
Sergey

Ok I’ll submit some issues regarding those then.

In the meanwhile, if anyone is looking for a workaround, this is a bit horrible but will work

  • create new TCanvas
  • clone TH2 object
  • draw cloned TH2 object on new canvas using “CONTLIST”
  • resume previous code block: either change back to previous canvas with canvas->cd() or create a new canvas to work on after this step

Pretty awful because it produces a whole new window, but it will work.

In the ticket please submit also a macro reproducing where you are and what you did. It may well be that a simpler solution exits.

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