How to increase the color number in afunction's surface plot

Hi,

is there a way to increase the number of colors a smooth the borders between the gradient colors in a 3D-plot of a 2D-function?
To draw a function defined as “Func1” I use

but the UV-gradient colors have some ugly steps :wink: I would like to smooth somehow or increase the number of colors.

Cheers & Thanks for any hint,
Thomas

  1. Define you own palette with any colors you want, as smooth as you want, or:
  2. Use gStyle->SetPalette(200); //or some large number.

Hi,
that won’t work. when the palette number is increased above 50 in gStyle->SetPalette() the standard deep sea (or so) palette is used but I would like to increase the number of colors for the UV-palette.

may be this can help:

{
   TCanvas *c  = new TCanvas("c","Contours",600,0,600,600);
   TF2 *f1 = new TF2("f2","0.1+(1-(x-2)*(x-2))*(1-(y-2)*(y-2))",1,3,1,3);
                                                                                
   Int_t Number = 5;
   Double_t Red[Number] = { 0.00, 0.09, 0.18, 0.09, 0.00 };
   Double_t Green[Number] = { 0.01, 0.02, 0.39, 0.68, 0.97 };
   Double_t Blue[Number] = { 0.17, 0.39, 0.62, 0.79, 0.97 };
   Double_t Stops[Number] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
                                                                                
                                                                                
   Int_t nb=50;
   TColor::CreateGradientColorTable(Number,Stops,Red,Green,Blue,nb);
   f2->SetContour(nb);
   f2->Draw("surf1z");
}