# How to plot 3D data in a TH2 or TH3, with z of the data as an adjustable parameter

**URL:** <https://root-forum.cern.ch/t/how-to-plot-3d-data-in-a-th2-or-th3-with-z-of-the-data-as-an-adjustable-parameter/50326>\
**Category:** Newbie\
**Tags:** hist\
**Created:** [June 9, 2022, 4:27am UTC](https://root-forum.cern.ch/t/how-to-plot-3d-data-in-a-th2-or-th3-with-z-of-the-data-as-an-adjustable-parameter/50326 "2022-06-09T04:27:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yue\_Feng](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/yue_feng/32/29953_2.png) [@Yue\_Feng](https://root-forum.cern.ch/u/Yue_Feng)\
**Post date:** [June 9, 2022, 4:27am UTC](https://root-forum.cern.ch/t/how-to-plot-3d-data-in-a-th2-or-th3-with-z-of-the-data-as-an-adjustable-parameter/50326/1 "2022-06-09T04:27:05Z")

</div>

Hi,

I am trying to plot a 3D dataset as histograms. It has two position dimensions and one intensity dimension. The way I want to present is, show how many points above a specific intensity are distributed in the two position dimensions. That intensity threshold will only allow the data points that have intensity larger than that to be plotted.  
Is it possible to have that threshold slider in th3 or th2? so when I use that slider to pick a threshold, only data points have z value(intensity) larger than that will be ploted, with the two position dimensions, and give a th2-like plot.

Thank you!  
Yue

* * *

\_ROOT Version: 6.24/06  
\_Platform: macos

* * *

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [June 9, 2022, 6:04am UTC](https://root-forum.cern.ch/t/how-to-plot-3d-data-in-a-th2-or-th3-with-z-of-the-data-as-an-adjustable-parameter/50326/2 "2022-06-09T06:04:23Z")

</div>

You can use SetMinimum in your code, e.g.

```auto
 histo->SetMinimum(yourthresholdvalue);
 histo->Draw("colz"); // if TH2 histogram

```
