Olivier Couet
2004-03-02 09:41:33 UTC
You can define more than 50 color. See the help of SetPalette in TStyle:
void TStyle::SetPalette(Int_t ncolors, Int_t *colors)
{
// The color palette is used by the histogram classes
// (see TH1::Draw options).
// For example TH1::Draw("col") draws a 2-D histogram with cells
// represented by a box filled with a color CI function of the cell
content.
// if the cell content is N, the color CI used will be the color number
// in colors[N],etc. If the maximum cell content is > ncolors, all
// cell contents are scaled to ncolors.
//
// if ncolors <= 0 a default palette (see below) of 50 colors is defined.
// the colors defined in this palette are OK for coloring pads, labels
//
// if ncolors == 1 && colors == 0, then
// a Pretty Palette with a Spectrum Violet->Red is created.
// It is recommended to use this Pretty palette when drawing legos,
// surfaces or contours.
//
// if ncolors > 50 and colors=0, the DeepSea palette is used.
// (see TStyle::CreateGradientColorTable for more details)
//
// if ncolors > 0 and colors = 0, the default palette is used
// with a maximum of ncolors.
//
// The default palette defines:
// index 0->9 : grey colors from light to dark grey
// index 10->19 : "brown" colors
// index 20->29 : "blueish" colors
// index 30->39 : "redish" colors
// index 40->49 : basic colors
//
// The color numbers specified in the palette can be viewed by selecting
// the item "colors" in the "VIEW" menu of the canvas toolbar.
// The color parameters can be changed via TColor::SetRGB.
This function is accessed via:
gStyle->SetPalette();
Cheers, O.Couet
void TStyle::SetPalette(Int_t ncolors, Int_t *colors)
{
// The color palette is used by the histogram classes
// (see TH1::Draw options).
// For example TH1::Draw("col") draws a 2-D histogram with cells
// represented by a box filled with a color CI function of the cell
content.
// if the cell content is N, the color CI used will be the color number
// in colors[N],etc. If the maximum cell content is > ncolors, all
// cell contents are scaled to ncolors.
//
// if ncolors <= 0 a default palette (see below) of 50 colors is defined.
// the colors defined in this palette are OK for coloring pads, labels
//
// if ncolors == 1 && colors == 0, then
// a Pretty Palette with a Spectrum Violet->Red is created.
// It is recommended to use this Pretty palette when drawing legos,
// surfaces or contours.
//
// if ncolors > 50 and colors=0, the DeepSea palette is used.
// (see TStyle::CreateGradientColorTable for more details)
//
// if ncolors > 0 and colors = 0, the default palette is used
// with a maximum of ncolors.
//
// The default palette defines:
// index 0->9 : grey colors from light to dark grey
// index 10->19 : "brown" colors
// index 20->29 : "blueish" colors
// index 30->39 : "redish" colors
// index 40->49 : basic colors
//
// The color numbers specified in the palette can be viewed by selecting
// the item "colors" in the "VIEW" menu of the canvas toolbar.
// The color parameters can be changed via TColor::SetRGB.
This function is accessed via:
gStyle->SetPalette();
Cheers, O.Couet
I have question concerning the color palette and the number of colors
that one can defined in ROOT. I am interested in using ROOT to view a
2D image in grayscale (black and white) using the 2D histogram. I need
a grayscale of at least 8 bits. As far as I can understand it, ROOT
has a maximum of 50 colors. Is there a way to get more colors, in
particular in grayscale? If not, is this a feature that would be added
in the future?
Seng
that one can defined in ROOT. I am interested in using ROOT to view a
2D image in grayscale (black and white) using the 2D histogram. I need
a grayscale of at least 8 bits. As far as I can understand it, ROOT
has a maximum of 50 colors. Is there a way to get more colors, in
particular in grayscale? If not, is this a feature that would be added
in the future?
Seng
--
Org: CERN - European Laboratory for Particle Physics.
Mail: 1211 Geneve 23 - Switzerland Mailbox: J25910
E-Mail: ***@cern.ch Phone: +41 22 7676522
WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7677155
Org: CERN - European Laboratory for Particle Physics.
Mail: 1211 Geneve 23 - Switzerland Mailbox: J25910
E-Mail: ***@cern.ch Phone: +41 22 7676522
WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7677155