Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
draw_pave.cxx File Reference

Detailed Description

This macro generates a small V7 TH1D, fills it and draw it in a V7 canvas.

The canvas is display in the web browser

/*************************************************************************
* Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#include "ROOT/RCanvas.hxx"
#include "ROOT/RPave.hxx"
#include "ROOT/RPaveText.hxx"
// macro must be here while cling is not capable to load
// library automatically for outlined function see ROOT-10336
R__LOAD_LIBRARY(ROOTGpadv7)
using namespace ROOT::Experimental;
void draw_pave()
{
// Create a canvas to be displayed.
auto canvas = RCanvas::Create("Canvas Title");
// RFrame will be automatically created as well
auto pave = canvas->Draw<RPave>();
pave->AttrFill().SetColor(RColor::kBlue);
pave->AttrBorder().SetColor(RColor::kGreen).SetWidth(3);
pave->SetCornerY(-0.03_normal);
pave->SetHeight(0.2_normal);
auto text = canvas->Draw<RPaveText>();
text->AddLine("This is RTextPave");
text->AddLine("It can have several lines");
text->AddLine("It should be positioned below RPave");
text->AttrFill().SetColor(RColor::kYellow);
text->SetCornerY(0.25_normal);
text->SetHeight(0.3_normal);
canvas->SetSize(1000, 700);
canvas->Show();
}
#define R__LOAD_LIBRARY(LIBRARY)
Definition Rtypes.h:472
RAttrFill & SetColor(const RColor &color)
The fill color.
Definition RAttrFill.hxx:39
Base class for paves with text, statistic, legends, placed relative to RFrame position and adjustable...
Definition RPave.hxx:31
RAttrFill & AttrFill()
Definition RPave.hxx:67
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:197
TText * text
Date
2015-03-22
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Author
Axel Naumann axel@.nosp@m.cern.nosp@m..ch

Definition in file draw_pave.cxx.