Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches

Detailed Description

This ROOT 7 example demonstrates how to create a ROOT 7 canvas (RCanvas) and draw ROOT 7 boxes in it (RBox).

It generates a set of boxes using the "normal" coordinates' system. Run macro with python3 -i box.py command to get interactive canvas

import ROOT
from ROOT.Experimental import RCanvas, RBox, RPadPos, RColor, RAttrFill, RAttrLine
# Create a canvas to be displayed.
canvas = RCanvas.Create("RBox drawing")
box1 = canvas.Draw[RBox](RPadPos(0.1, 0.1), RPadPos(0.3, 0.6))
box1.fill.color = RColor(0, 255, 0, 127) # 50% opaque
box2 = canvas.Draw[RBox](RPadPos(0.4, 0.2), RPadPos(0.6, 0.7))
box2.fill.color = RColor(0, 0, 255, 179) # 70% opaque
box3 = canvas.Draw[RBox](RPadPos(0.7, 0.4), RPadPos(0.9, 0.6))
box4 = canvas.Draw[RBox](RPadPos(0.7, 0.7), RPadPos(0.9, 0.9))
box5 = canvas.Draw[RBox](RPadPos(0.7, 0.1), RPadPos(0.9, 0.3))
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Date
2021-06-15
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Author
Sergey Linev

Definition in file rbox.py.