# Howto

**URL:** https://root-forum.cern.ch/c/howto/23.md

[Latest](https://root-forum.cern.ch/latest.md) · [Categories](https://root-forum.cern.ch/categories.md) · [Tags](https://root-forum.cern.ch/tags.md)

---

## [About the Howto category](https://root-forum.cern.ch/t/about-the-howto-category/28245)

<div class="topic-metadata">

**Author:** [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 10:23am UTC](https://root-forum.cern.ch/t/about-the-howto-category/28245 "2018-03-09T10:23:08Z")

</div>

Tutorial topics that describe how to use set up, configure, install, and use ROOT using a specific platform or environment. Topics in this category may only be created by administrators and moderators.

---

## [Running ROOT tests](https://root-forum.cern.ch/t/running-root-tests/37177)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [December 12, 2019, 12:40pm UTC](https://root-forum.cern.ch/t/running-root-tests/37177 "2019-12-12T12:40:38Z")

</div>

We run the ROOT tests using ctest driver. All tests are defined within the CTest framework. The following tests categories exists: ROOT basic tests delivered in: $ROOTSYS/test ROOT tutorials delivered in: $ROOTSYS/tut…

---

## [How to set ranges on axis?](https://root-forum.cern.ch/t/how-to-set-ranges-on-axis/28254)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 12:11pm UTC](https://root-forum.cern.ch/t/how-to-set-ranges-on-axis/28254 "2018-03-09T12:11:15Z")

</div>

The viewing range for a histogram axis can be set from bin ifirst to ilast using the method TAxis::SetRange(ifirst, ilast). Example (hpxpy is a 2D histogram): { TFile f("hsimple.root"); hpxpy-\>Draw("colz"); hpx…

---

## [GUI on high resolution screens](https://root-forum.cern.ch/t/gui-on-high-resolution-screens/52133)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [October 28, 2022, 8:41am UTC](https://root-forum.cern.ch/t/gui-on-high-resolution-screens/52133 "2022-10-28T08:41:01Z")

</div>

Author: @petrstepanov Hi all, I’ve recently put my hands on a 2015 Retina MacBook with Intel Iris 6100 graphics card and I’ve been tinkering around the problem on various desktop environments and display servers. Here i…

---

## [Report a bug or an issue](https://root-forum.cern.ch/t/report-a-bug-or-an-issue/37176)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [December 12, 2019, 12:39pm UTC](https://root-forum.cern.ch/t/report-a-bug-or-an-issue/37176 "2019-12-12T12:39:00Z")

</div>

We use “GitHub Issues” to report bugs. You can: Report an issue on ROOT itself Report an issue on the ROOT website All you need is a GitHub account which is very common these days.

---

## [Complete ROOT Installation Instructions for WSL (Ubuntu 18.04 on Windows 10)](https://root-forum.cern.ch/t/complete-root-installation-instructions-for-wsl-ubuntu-18-04-on-windows-10/35148)

<div class="topic-metadata">

**Author:** [@Axel](https://root-forum.cern.ch/u/Axel)\
**Replies:** 2\
**Last updated:** [January 12, 2022, 3:14pm UTC](https://root-forum.cern.ch/t/complete-root-installation-instructions-for-wsl-ubuntu-18-04-on-windows-10/35148 "2022-01-12T15:14:24Z")

</div>

From @olifre : Install WSL ( https://aka.ms/install ) and then Ubuntu 18.04 from the Windows Store. The first step is not needed anymore for most recent Windows 10 versions, I think. Start the freshly installed Ubuntu …

---

## [How to convert Hbook/PAW files to ROOT](https://root-forum.cern.ch/t/how-to-convert-hbook-paw-files-to-root/44411)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [April 14, 2021, 1:15pm UTC](https://root-forum.cern.ch/t/how-to-convert-hbook-paw-files-to-root/44411 "2021-04-14T13:15:48Z")

</div>

Use h2root (a program to convert an HBOOK file into a ROOT file) This program is delivered with the ROOT distribution. It is invoked via: h2root hbook\_file\_name root\_file\_name compress tolower if the second paramete…

---

## [How to Fit Histograms or Data Points?](https://root-forum.cern.ch/t/how-to-fit-histograms-or-data-points/38870)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [April 14, 2020, 8:48am UTC](https://root-forum.cern.ch/t/how-to-fit-histograms-or-data-points/38870 "2020-04-14T08:48:03Z")

</div>

Fitting in ROOT is based on the TMinuit class. See in particular \[Basic Concepts of Minuit\](ROOT: TMinuit Class Reference Concepts of Minuit). The user has the choice of using directly the TMinuit class, as illustrate…

---

## [How to Quickly Inspect the Content of a File?](https://root-forum.cern.ch/t/how-to-quickly-inspect-the-content-of-a-file/38086)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [February 21, 2020, 3:33pm UTC](https://root-forum.cern.ch/t/how-to-quickly-inspect-the-content-of-a-file/38086 "2020-02-21T15:33:15Z")

</div>

Note: The root command line tools were released with ROOT 6.06. ROOT provides command line tools that allow you to quickly inspect and modify the content of ROOT files. They can be divided in two categories: The ones …

---

## [How to Integrate ROOT into my project with CMake](https://root-forum.cern.ch/t/how-to-integrate-root-into-my-project-with-cmake/37175)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [December 12, 2019, 12:36pm UTC](https://root-forum.cern.ch/t/how-to-integrate-root-into-my-project-with-cmake/37175 "2019-12-12T12:36:14Z")

</div>

Integrating ROOT into your CMake based project should be straight forward. The main interface is the CMake command find\_package(…), which defines the following standard variables: variable type description ROOT\_…

---

## [How to redraw Axis and plot borders?](https://root-forum.cern.ch/t/how-to-redraw-axis-and-plot-borders/28252)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 12:00pm UTC](https://root-forum.cern.ch/t/how-to-redraw-axis-and-plot-borders/28252 "2018-03-09T12:00:33Z")

</div>

Sometimes, when several plots are drawn in the same pad using the option SAME, the axis tick marks and the plot’s border lines might be erased by the front plots. It might be useful to redraw them. The following example …

---

## [Valgrind and ROOT](https://root-forum.cern.ch/t/valgrind-and-root/28506)

<div class="topic-metadata">

**Author:** [@Axel](https://root-forum.cern.ch/u/Axel)\
**Replies:** 0\
**Last updated:** [March 29, 2018, 1:40pm UTC](https://root-forum.cern.ch/t/valgrind-and-root/28506 "2018-03-29T13:40:31Z")

</div>

Memory Checks ROOT triggers a couple of valgrind reports that are intentional (see below if you care why). To suppress those use the following invocation: valgrind --num-callers=30 --suppressions=$ROOTSYS/etc/valgrind-r…

---

## [Tips for Efficient and Successful Posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292)

<div class="topic-metadata">

**Author:** [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Replies:** 0\
**Last updated:** [March 13, 2018, 8:27am UTC](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292 "2018-03-13T08:27:04Z")

</div>

This forum is intended to help with problems, allow individuals to collaborate on the ROOT project, to answer questions, and generally communicate and debate, especially in relation to using or programming with ROOT. Bef…

---

## [How to change the position of the statistics box on histogram plot?](https://root-forum.cern.ch/t/how-to-change-the-position-of-the-statistics-box-on-histogram-plot/28262)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 4:40pm UTC](https://root-forum.cern.ch/t/how-to-change-the-position-of-the-statistics-box-on-histogram-plot/28262 "2018-03-09T16:40:19Z")

</div>

It is explained in the reference guide. Basically, after the histogram has been plotted with its statistic box, it is enough to retrieve it in the histograms’ list of objects and change its position like shown in the fol…

---

## [How to Use the Graphics Editor?](https://root-forum.cern.ch/t/how-to-use-the-graphics-editor/28255)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 12:15pm UTC](https://root-forum.cern.ch/t/how-to-use-the-graphics-editor/28255 "2018-03-09T12:15:45Z")

</div>

ROOT has a simple built-in graphics editor to draw and edit basic primitives starting from an empty canvas or on top of a picture (eg. histogram). The editor is started by selecting the Editor item in the canvas Edit me…

---

## [How to draw several TGraph in one common axis system?](https://root-forum.cern.ch/t/how-to-draw-several-tgraph-in-one-common-axis-system/28261)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 4:13pm UTC](https://root-forum.cern.ch/t/how-to-draw-several-tgraph-in-one-common-axis-system/28261 "2018-03-09T16:13:48Z")

</div>

Use TMultiGraph.

---

## [How to change the automatic plot title produced when a tree is drawn?](https://root-forum.cern.ch/t/how-to-change-the-automatic-plot-title-produced-when-a-tree-is-drawn/28260)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 4:12pm UTC](https://root-forum.cern.ch/t/how-to-change-the-automatic-plot-title-produced-when-a-tree-is-drawn/28260 "2018-03-09T16:12:34Z")

</div>

It is enough to change the title of the histogram htemp: tree.Draw("x:y"); htemp.SetTitle("New Title");

---

## [Some or all windows don't get displayed when ROOT is running on a remote computer](https://root-forum.cern.ch/t/some-or-all-windows-dont-get-displayed-when-root-is-running-on-a-remote-computer/28259)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 4:11pm UTC](https://root-forum.cern.ch/t/some-or-all-windows-dont-get-displayed-when-root-is-running-on-a-remote-computer/28259 "2018-03-09T16:11:33Z")

</div>

You probably used ssh to connect to the remote computer. You need to specify the option “-Y” which turns on trusted X11 forwarding.

---

## [How to render graphics in a file, without displaying the image on the screen?](https://root-forum.cern.ch/t/how-to-render-graphics-in-a-file-without-displaying-the-image-on-the-screen/28258)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 4:10pm UTC](https://root-forum.cern.ch/t/how-to-render-graphics-in-a-file-without-displaying-the-image-on-the-screen/28258 "2018-03-09T16:10:00Z")

</div>

Run in batch mode: root -b -q myscript.C or in your program add: gROOT-\>SetBatch();

---

## [Changing the Displayed Title in Canvas](https://root-forum.cern.ch/t/changing-the-displayed-title-in-canvas/28257)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 4:08pm UTC](https://root-forum.cern.ch/t/changing-the-displayed-title-in-canvas/28257 "2018-03-09T16:08:34Z")

</div>

Disable the title and add yourself your own title with a TPaveLabel: gStyle-\>SetOptTitle(0); TPaveLabel \*title = new TPaveLabel(.11,.95,.35,.99,"new title","brndc"); title-\>Draw();

---

## [What is the difference between a TFolder and a TDirectory?](https://root-forum.cern.ch/t/what-is-the-difference-between-a-tfolder-and-a-tdirectory/28256)

<div class="topic-metadata">

**Author:** [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 3:56pm UTC](https://root-forum.cern.ch/t/what-is-the-difference-between-a-tfolder-and-a-tdirectory/28256 "2018-03-09T15:56:06Z")

</div>

TFolder manages a hierarchy of objects in memory. TDirectory is doing it for a file. One can save the TFolder structure to a directory in a file.

---

## [How to Embed a TCanvas in External Applications?](https://root-forum.cern.ch/t/how-to-embed-a-tcanvas-in-external-applications/28247)

<div class="topic-metadata">

**Author:** [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 11:17am UTC](https://root-forum.cern.ch/t/how-to-embed-a-tcanvas-in-external-applications/28247 "2018-03-09T11:17:19Z")

</div>

Here is a short HOWTO showing the few steps required to embed a TCanvas in an application created with toolkits as QT, FOX, MFC, and probably many more. IMPORTANT: Do not call TApplication::Run() In the application co…

---

## [How to Draw Objects?](https://root-forum.cern.ch/t/how-to-draw-objects/28249)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 11:50am UTC](https://root-forum.cern.ch/t/how-to-draw-objects/28249 "2018-03-09T11:50:32Z")

</div>

One can draw an object via object-\>Draw(option). This function adds a reference to the object in the list of objects to be drawn in the current pad or canvas. If a canvas does not exist, a default canvas (named c1) is au…

---

## [How to let graphics primitives respond to a mouse click?](https://root-forum.cern.ch/t/how-to-let-graphics-primitives-respond-to-a-mouse-click/28250)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 11:53am UTC](https://root-forum.cern.ch/t/how-to-let-graphics-primitives-respond-to-a-mouse-click/28250 "2018-03-09T11:53:56Z")

</div>

This can be done by adding a TExec object in a TCanvas. The following macro gives an example. It generates 50 small triangles randomly in the canvas. Each triangle get a unique identifier and a random color. Once this ma…

---

## [How to Pick Objects?](https://root-forum.cern.ch/t/how-to-pick-objects/28251)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 11:58am UTC](https://root-forum.cern.ch/t/how-to-pick-objects/28251 "2018-03-09T11:58:02Z")

</div>

When the mouse is moved or a button pressed/released, the TCanvas::HandleInput function scans the list of objects in all its pads and for each object invokes object-\>DistancetoPrimitive(px, py). This function computes a …

---

## [How to reuse a user's defined color palette?](https://root-forum.cern.ch/t/how-to-reuse-a-users-defined-color-palette/28253)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 12:08pm UTC](https://root-forum.cern.ch/t/how-to-reuse-a-users-defined-color-palette/28253 "2018-03-09T12:08:12Z")

</div>

Each time TColor::CreateGradientColorTable is called it tries to find new space for the new color palette. Therefore if an application tries to switch between several palettes, it will becomes slower and slower each time…

---

## [How to draw an object with special characters in its name?](https://root-forum.cern.ch/t/how-to-draw-an-object-with-special-characters-in-its-name/28248)

<div class="topic-metadata">

**Author:** [@couet](https://root-forum.cern.ch/u/couet)\
**Replies:** 0\
**Last updated:** [March 9, 2018, 11:37am UTC](https://root-forum.cern.ch/t/how-to-draw-an-object-with-special-characters-in-its-name/28248 "2018-03-09T11:37:51Z")

</div>

In general it is not a good idea to have object’s name containing special character like “”, “/”, “#” etc … or even have object name starting with a number because they might be not accessible from the ROOT command line. …
