14 const Int_t paletteSize = 10;
15 Float_t rgb[paletteSize * 3] =
27 Int_t palette[paletteSize] = {0};
29 for (Int_t i = 0; i < paletteSize; ++i)
30 palette[i] = TColor::GetColor(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]);
32 gStyle->SetPalette(paletteSize, palette);
34 gStyle->SetCanvasPreferGL(1);
35 TCanvas *cnv =
new TCanvas(
"glc",
"Surface sample", 200, 10, 600, 550);
37 TPaveLabel *title =
new TPaveLabel(0.04, 0.86, 0.96, 0.98,
38 "\"glsurf2pol\" option + user defined palette.");
39 title->SetFillColor(32);
42 TPad *rosePad =
new TPad(
"box",
"box", 0.04, 0.04, 0.96, 0.8);
46 TF2 *fun =
new TF2(
"a",
"cos(y)*sin(x)+cos(x)*sin(y)", -6, 6, -6, 6);
47 fun->SetContour(paletteSize);
51 fun->Draw(
"glsurf2pol");