Additional histograms in cont4-plots

Hello out there,

I’d like to use a contour plot with “cont4” option instead of “colz” because it looks much nicer. With “colz” I use an additional “cont3” plot to improve the visibility of the contour levels. As I have read and have experienced myself, this is not possible with “cont4” plots, the “cont3” plot is just never visible. Is there a different way to draw those lines or a solution how to draw the “cont3” plot?

thanks
Nico

Use cont0 instead of cont4

Rene

Maybe I’m doing it in totally the wrong way but cont0 looks quite strange (see attachment).




Use a transparent pad like in the following example:

{

   TCanvas *c  = new TCanvas("c","Contour",0,0,800,700);

   TF2 *f2 = new TF2("f2","0.1+1000*((1-(x-2)*(x-2))*(1-(y-2)*(y-2)))",1,3,1,3);
   f2->SetFillStyle(1000);
   f2->SetLineWidth(1);

   double contours[3];
   contours[0] = 500;
   contours[1] = 700;
   contours[2] = 900;
   f2->SetContour(3,contours);

   Int_t colors[3] = {kRed, kYellow, kGreen};
   gStyle->SetPalette(3,colors);

   f2->Draw("cont4 z");

   TPad *pad1 = new TPad("pad1","",0,0,1,1);
   pad1->SetFillStyle(0);
   pad1->SetFrameFillStyle(0);
   pad1->Draw();
   pad1->cd();
   f2->Draw("cont3");
}

the cont4 option uses a nomalized corrdinates system. That’s why the option SAME doesn’t work directly on it.

Wow, that really works fine!

Thanks a lot!