TH2F COLZ histogram without axis box around

Dear ROOT experts,

I would like to draw a TH2F with the COLZ option without the axis box around it.
Is that possible?

I found how to hide the axis labels,
but not the axis box itself.

Best regards
Felix

I think if you just plot with the option “col” instead of “colz”, it will not display the Z axis scale. Is that what you are asking about?

  • Hide the labels
  • make the tick length = 0 (or epsilon)
  • plot using COL only

Simpler:

hpxpy->Draw(“COLA”)

Thank you for your answers. I should have made my question clearer:

I am currently using COLZA as draw options and I want to keep
the z-color-scale on the right.

What I want to hide is the black box around the main plot
on which the x and y axis sits. The option A hides the ticks
and the axis labels, but not the black line around the plot itself.

Is there a way the remove this line or recolor it?

Best regards
Felix

   TCanvas *c1 = new TCanvas("c1", "c1",10,32,700,502);
   c1->SetFrameLineColor(0);
   TCanvas *c1 = new TCanvas("c1", "c1",10,32,700,502);
   c1->SetFrameLineColor(0);

Perfect! That is I was looking for.

I’m having troubles in trying to do the same with a TH3. SetFrameLineColor(0) or SetFrameLineWidth(0) has no effect…

TH3D h("h", "h", 10, -10, 10, 10, -10, 10, 10, -10, 10);
h.Draw("A");

3D plots have special options to remove the front box and the back box of the plot:

h.Draw("A FB BB");
1 Like