How to hide/remove TFrame from TF2

Hi,

I’m trying to draw a TF2 with surf2 or surf4 option, without axes and without frame.

For a TF1, I can do:

TF1 *f1 = new TF1("f1","x",-1,1);
f1->Draw("AL");
TFrame *fr = (TFrame*)gPad->GetFrame();
fr->SetLineColor(kWhite);
gPad->Modified();

which gets rid of the axis and frame.

For the TF2 version however, any changes made to the TFrame gotten from gPad, do not seem to change the plotted frame. Do I need to fetch a different object? And if I can get rid of the frame, will it also get rid of the extra dashed lines that come with the bare frame?

TF2 *f2 = new TF2("f2","x*y",-1,1,-1,1); f2->Draw("ASURF4"); ...?

Please let me know if I need to provide a full MWE.

Thanks,
Sara

The option are BB and FB to remove the back and front
See doc

Thanks, that’s exactly what I needed.