# Problem using logarithmic color axis/colz with TNtuple

XMLWordPrintable

#### Details

• Bug
• Status: Closed
• High
• Resolution: Clarified
• None
• None
• None
• GNU/Linux

• bugs93229

#### Description

Hi,

I am trying to plot 3 sets of data using TNtuple with a logarithmic color/z-axis.
Actually in my case &quot;SetLogz()&quot; doesn't work.
More precisely, it's possible to make the z-axis logarithmic but it won't be linked to the color code in the plot

Below one simple example :

[code]
#include &lt;TStyle.h&gt;
#include &lt;TCanvas.h&gt;
#include &lt;TNtuple.h&gt;
{
TNtuple* nt = new TNtuple(&quot;nt&quot;,&quot;&quot;,&quot;a:b:c&quot;
TCanvas *Can = new TCanvas(&quot;Can&quot;,&quot;&quot;,200,10,600,400);

Double_t x[16] =

{1.00, 2.00, 6.00, 7.00, 3.00, 10.00, 0.20, 5.55, 20.50, 9.75, 1.50, 8.00, 5.00, 0.95, 3.85, 8.70};
Double_t y[16] = {1.00, 2.00, 6.00, 7.00, 3.00, 10.00, 0.20, 5.55,20.50, 9.75, 1.50, 8.00, 5.00, 0.95, 3.85, 8.70}

;
Double_t z[16] =

{0.001, 2.50, 600.00, 0.00001, 30.00, 10.001, 0.00020, 500000.55, 20.50, 9.75, 280000.50, 8.00, 5.00, 0.95, 3.85, 8.70}

;

Double_t x3, y3, z3;

for(Int_t h1 =0;h1&lt;16;++h1)
{
x3 = x[h1];
y3 = y[h1];
z3 = z[h1]; nt-&gt;Fill(x3,y3,z3);
}
Can-&gt;SetTickx(1);
gStyle-&gt;SetOptStat(0);
gStyle-&gt;SetPalette(1,0);
nt-&gt;SetMarkerStyle(20);
nt-&gt;SetMarkerSize(1);
nt-&gt;Draw(&quot;b:a:c&quot;,&quot;c&quot;,&quot;colz&quot;
}
[/code]

Normally the point with z=280000.50 should be in red when z-axis is logarithmic, but it's not the case.

If i try a brutal fix like :

[code]
if (gPad-&gt;GetLogz()) nt-&gt;Draw(&quot;b:a:log10(c)*(c&gt;0)&quot;, &quot;&quot;, &quot;colz&quot;
else nt-&gt;Draw(&quot;b:a:c&quot;, &quot;&quot;, &quot;colz&quot;
[/code]

the problem is still here.
For instance for the isolated point in the plot, with z=20.5, if we take log10(20.5), approximately = 1.3, logarithmic scale shows us that z would be around 0.2 - 0.3.

Thanks

#### People

Olivier Couet
None (Inactive)