Discussion:
TH2: Z-axis range
Serhiy Senyukov
2013-03-19 09:49:01 UTC
Permalink
Dear ROOTers,

I have a question concerning the TH2 histograms.
I have an TH2I histogram that I draw with the COLZ options.
How can I adjust the range of the Z-axis in order to see only bins with the Z_min<=Z_bin<=Z_max?
With the TH1::SetMinimum(Z_min) I can put the the lower limit. All the bins with the content smaller that Z_min will be white at the color scale and thus invisible.
It doesn't work with the upper limit. When I use TH1::SetMaximum(Z_max) all the elements bigger than Z_max just saturate the color scale and Z_max. It means that it is impossible to separate the bins with the Z=Z_max and Z>Z_max.

Is there any smart way to filter-out completely the bins higher than the upper limit in order to not to see them on the plot?

Thank you in advance for the suggestions.
Regards,
Serhiy.
Tomas Davidek
2013-03-19 09:55:22 UTC
Permalink
Hi Serhiy,
what about histo->GetZaxis()->SetRangeUser(zmin,zmax), would that help?

Cheers,
Tomas
Post by Serhiy Senyukov
Dear ROOTers,
I have a question concerning the TH2 histograms.
I have an TH2I histogram that I draw with the COLZ options.
How can I adjust the range of the Z-axis in order to see only bins
with the Z_min<=Z_bin<=Z_max?
With the TH1::SetMinimum(Z_min) I can put the the lower limit. All the
bins with the content smaller that Z_min will be white at the color
scale and thus invisible.
It doesn't work with the upper limit. When I use
TH1::SetMaximum(Z_max) all the elements bigger than Z_max just
saturate the color scale and Z_max. It means that it is impossible to
separate the bins with the Z=Z_max and Z>Z_max.
Is there any smart way to filter-out completely the bins higher than
the upper limit in order to not to see them on the plot?
Thank you in advance for the suggestions.
Regards,
Serhiy.
Olivier Couet
2013-03-19 10:05:28 UTC
Permalink
When the bins are smaller that the minimum they are not drawn.
Bins greater or equal to the maximum are drawn with the upper colour of the palette.
You can see that the palette drawn near the plot matches that.
Set Range user does the same.
What wowld you expect ?
The palette drawn from the real minimum of the histo until the real max and the histo drawn with the
imposed min and max ?

On Mar 19, 2013, at 10:49 AM, Serhiy Senyukov <***@cern.ch<mailto:***@cern.ch>>
wrote:

Dear ROOTers,

I have a question concerning the TH2 histograms.
I have an TH2I histogram that I draw with the COLZ options.
How can I adjust the range of the Z-axis in order to see only bins with the Z_min<=Z_bin<=Z_max?
With the TH1::SetMinimum(Z_min) I can put the the lower limit. All the bins with the content smaller that Z_min will be white at the color scale and thus invisible.
It doesn't work with the upper limit. When I use TH1::SetMaximum(Z_max) all the elements bigger than Z_max just saturate the color scale and Z_max. It means that it is impossible to separate the bins with the Z=Z_max and Z>Z_max.

Is there any smart way to filter-out completely the bins higher than the upper limit in order to not to see them on the plot?

Thank you in advance for the suggestions.
Regards,
Serhiy.
Serhiy Senyukov
2013-03-19 10:19:45 UTC
Permalink
Hi Olivier,

I am looking for a solution to not to draw the bins that are greater than the maximum.

Regards,
Serhiy.

________________________________
From: Olivier Couet
Sent: 19 March 2013 11:05
To: Serhiy Senyukov
Cc: roottalk (Mailing list for ROOT users.)
Subject: Re: TH2: Z-axis range

When the bins are smaller that the minimum they are not drawn.
Bins greater or equal to the maximum are drawn with the upper colour of the palette.
You can see that the palette drawn near the plot matches that.
Set Range user does the same.
What wowld you expect ?
The palette drawn from the real minimum of the histo until the real max and the histo drawn with the
imposed min and max ?

On Mar 19, 2013, at 10:49 AM, Serhiy Senyukov <***@cern.ch<mailto:***@cern.ch>>
wrote:

Dear ROOTers,

I have a question concerning the TH2 histograms.
I have an TH2I histogram that I draw with the COLZ options.
How can I adjust the range of the Z-axis in order to see only bins with the Z_min<=Z_bin<=Z_max?
With the TH1::SetMinimum(Z_min) I can put the the lower limit. All the bins with the content smaller that Z_min will be white at the color scale and thus invisible.
It doesn't work with the upper limit. When I use TH1::SetMaximum(Z_max) all the elements bigger than Z_max just saturate the color scale and Z_max. It means that it is impossible to separate the bins with the Z=Z_max and Z>Z_max.

Is there any smart way to filter-out completely the bins higher than the upper limit in order to not to see them on the plot?

Thank you in advance for the suggestions.
Regards,
Serhiy.
Olivier Couet
2013-03-19 10:31:44 UTC
Permalink
Hi Serhiy,

There is not straight forward way. The only possibility I can think of
is to create a new histogram (clone) and set all the bins greater
to the max to 0. A simple double loop can do that.

Cheers,
Olivier


On Mar 19, 2013, at 11:19 AM, Serhiy Senyukov <***@cern.ch<mailto:***@cern.ch>> wrote:

Hi Olivier,

I am looking for a solution to not to draw the bins that are greater than the maximum.

Regards,
Serhiy.

________________________________
From: Olivier Couet
Sent: 19 March 2013 11:05
To: Serhiy Senyukov
Cc: roottalk (Mailing list for ROOT users.)
Subject: Re: TH2: Z-axis range

When the bins are smaller that the minimum they are not drawn.
Bins greater or equal to the maximum are drawn with the upper colour of the palette.
You can see that the palette drawn near the plot matches that.
Set Range user does the same.
What wowld you expect ?
The palette drawn from the real minimum of the histo until the real max and the histo drawn with the
imposed min and max ?

On Mar 19, 2013, at 10:49 AM, Serhiy Senyukov <***@cern.ch<mailto:***@cern.ch>>
wrote:

Dear ROOTers,

I have a question concerning the TH2 histograms.
I have an TH2I histogram that I draw with the COLZ options.
How can I adjust the range of the Z-axis in order to see only bins with the Z_min<=Z_bin<=Z_max?
With the TH1::SetMinimum(Z_min) I can put the the lower limit. All the bins with the content smaller that Z_min will be white at the color scale and thus invisible.
It doesn't work with the upper limit. When I use TH1::SetMaximum(Z_max) all the elements bigger than Z_max just saturate the color scale and Z_max. It means that it is impossible to separate the bins with the Z=Z_max and Z>Z_max.

Is there any smart way to filter-out completely the bins higher than the upper limit in order to not to see them on the plot?

Thank you in advance for the suggestions.
Regards,
Serhiy.

Continue reading on narkive:
Loading...