Skip to content

Plotting histograms

Plotting histograms#

Draw options#

To plot an histogram, one just have to double click on it. It will be displayed using the Draw Option written on the top of panel 2.

The draw options are the standard ones from ROOT, with few more possibilities

  • norm: Normalize the histogram in area,
  • add: add the histogram to the current one,
    • add(2) will add the histogram with factor 2,
  • div: divide the histogram with the current one,
    • div(2) will divide the histogram with factor 2,
  • mult: multiply the histogram with the current one,
    • mult(2) multiply the histogram with factor 2,

The Draw options can be added: ex: "hist norm same" will draw the selected histogram, normalised, on the same pad than the current histogram.

Histogram manipulations#

A color wheel with default colors suggested by ROOT is integrated in Cubix (see the ROOT article). To change the color of an histogram using these colors, press c with the histogram under the cursor.

Histograms can be cut/copy/paste from one canvas to another. Right click on the histogram and select cut/copy, and then on another canvas, right click: paste.

An histogram can be removed from the current pad without being deleted, for this use right click: Undraw

An histogram already plotted in the canvas can be normalized or scaled using right click: Normalize/Scale

If the cursor is on an histogram, pressing SHIFT + wheel up/down scale up/down the histogram.

A raw histogram can be calibrated (if the calibration function has been defined in the current Workspace), using right click: Apply calibration

Zoom utilities#

Some tools have been added to the standard ROOT possibilities.

  • With the Shift key staying pressed, a click+slide with the mouse will draw a box on the canvas. When releasing the mouse click, the x range of the box will be applied to the histogram

  • With the Shift key pressed, a click on the canvas will make the range between zero and the clicked energy value.

  • With the Shift key pressed, a double click will unzoom the x axis.

  • On multi-pads Canvases, adding Ctrl+Shift apply the same zoom on all the pads.

  • When a zoom is applied on the X-axis (for 1D) or X and Y (for 2D), the keybord arrows allow to move on the histogram with the same zoom.

  • The wheel up/down allow on 1D histogram to zoom in/out on the Y axis (the cursor needs to be anywhere but not on an axis).

  • A X-axis range can be saved using z and applyed on an other one using Z.

Keyboard shortcuts#

A large number of keyboard shortcuts are available.

There is one known issue with keyboard shortcuts.

It a text zone has been clicked (like Draw Options, ENSDF nuclei...), instead of applying the keyboard shortcut, it will write the text in the text entry. This issue cannot be fixed. The only known solution for this is to switch to another window (like the terminal), and switch again on the cubix window to recover the ability of using keyboard shortcuts.

Find bellow the list of available shortcuts:

Key Result
CTRL+i Print the shortcuts info in the terminal
Histogram manipulation
c Increment the color of the histogram under cursor
CTRL+c Copy histogram under cursor
CTRL+x Cut histogram under cursor (copy and undraw)
CTRL+v Paste the copied histogram in the current canvas (add to current ones)
CTRL+d Undraw histogram under cursor
SHIFT+s Add the spectrum under the cursor to the saved list
CTRL+n Normalize histogram under cursor in area
CTRL+m Normalize histogram under cursor to the maximum
SHIFT+wheel Scale histogram under cursor
Canvas manipulation
n Open a new canvas
CTRL+g set/unset grid on X and Y axes
SHIFT+c set/unset CrossHair (wheel click to measure distances)
CTRL+u Update canvas
z Save the current X-axis range
Z Apply the saved X-axis range
F12 Unzoom
F9 set/unset log scale on X axis
F10 set/unset log scale on Y axis
F11 set/unset log scale on Z axis
Arrows Move on axis under cursor
Peak utilities
s Peak search (see Peak fitter section)
f Start a new fit definition (see Peak fitter section)
CTRL+f Perform the fit for the selected peaks (or double click)
CTRL+a Start the calibration utility
c Clear current fits and peak search values
r Remove the arrow (from peak search or ENSDF) under the cursor
Gamma-Gamma mode
g Add a gate
g+g Add a gate (open a dialog to set energy and width)
b Add a background
b+b Add a background (open a dialog to set energy and width)
c Clear all gates and background
d Remove the gate under the cursor
p Project