Re: Grid line properties

Rene Brun (Rene.Brun@cern.ch)
Fri, 03 Jul 1998 09:38:09 +0200


Jonathan M. Gilligan wrote:
>
> This is such a simple question, I feel I should be able to find it in the
> manual, but I can't figure out where to look. Is there a simple way to set
> the color of the grid lines on a Pad or Canvas? I want to make them a light
> gray so they don't stand out so intensely and interfere with seeing my data.
>

Jonathan,
The grid lines are drawn with the color specified for the axis itself.
To make them with light grey, use color 16 ,17 or 18 for example.
Assume you want to draw an histogram hist and set the grid color:
TCanvas *c1 = new TCanvas("c1");
c1->SetGrid();
hist->Draw();
hist->GetXaxis()->SetAxisColor(17);
hist->GetYaxis()->SetAxisColor(17);
c1->RedrawAxis();

The last statement may be necessary to redraw the axis lines in
solid mode because the current grid algorithm may draw the grid lines
on top of the axis lines when they coincide.

Rene Brun