Ticks in the foreground

hi,
apologize for this basic question, but I have a pad with ticks on the four sides. if i draw say a box that i fill, the ticks get hidden. do you know how i can get the ticks on the foreground? is this feasible at all?
if i save as an .eps file, clearly the ticks are hiden
an example is given below
root -l
gStyle->SetPadTickX(1);
gStyle->SetPadTickY(1);
gROOT->ForceStyle();
TCanvas * c = new TCanvas();
TH1D* h= new TH1D(“h”,"",100,0,100);
h->SetMaximum(5);
h->SetMinimum(0);
h->Draw();
TBox* b = new TBox(50,0,100,4.5);
b->SetFillColor(5);
b->SetFillStyle(3001);
b->Draw();

put gPad->RedrawAxis(); at the end of your macro.

thank you!

Hi,

this seems to make digits and labels of an axis two times more bold. Is there any other way to make ticks reappear from background?

Add h->Draw(“SAME AXIS”); in the end of your macro (maybe it will behave better and you will not get “double” axes).

In any case, maybe you should report your ROOT version and your operating system version (I don’t seem to get “double” axes when I try gPad->RedrawAxis(); nor h->Draw(“SAME AXIS”);).

h->Draw("SAME AXIS");

still makes it bold. It’s hard to notice, but it is more bold than without it.
I’m attaching two examples: one is bolded, the other is not but the ticks are missing.

Tried two different ROOT versions: 5.27/02 & 5.30.05, operating system is
Scientific Linux CERN SLC release 5.8 (Boron) - it’s lxplus.




Maybe you could post “.ps” and “.pdf” versions (of both pictures), too.

On your pictures it is not clear the 2nd has bolder labels.

If you carefully compare them you will see that axes labels and titles are really “bolder” (ticks seem to be “equal”, though).
I suspect that the problem is related to “anti-aliasing” / “supersampling” when “.gif” files are created (that’s why I asked for “.ps” and ".pdf which should be “free” from it). I suspect that there will be a difference in behaviour between “raster graphics” and “vector graphics” formats.

Labels a redrawn also and on small text it might do this effect if the anti-aliasing does not fit exactly with the previous axis. On PDF and PS it should be fine. Or if you look at the picture without comparing it should be ok.

I tried many different ways with

and without - the results are the following:

  1. Saved plots as PDFs in 5.27/02 - behavior is exactly like in GIFs attached.
  2. Saved them as PSs in 5.27/02, PDF and PSs in 5.30/05 and - perfect, it’s not bolded and ticks are present!

Thanks to all for your valuable advice!