Logo ROOT  
Reference Guide
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();
}
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.

ROOT::Experimental::RCanvas::Create
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
Definition: RCanvas.cxx:103
text
TText * text
Definition: entrylist_figure1.C:10
RCanvas.hxx
ROOT::Experimental::RColor::kBlue
static constexpr R__DLLEXPORT RGB_t kBlue
Definition: RColor.hxx:186
RPave.hxx
TCanvas::Show
void Show()
Show canvas.
Definition: TCanvas.cxx:2238
ROOT::Experimental::RColor::kGreen
static constexpr R__DLLEXPORT RGB_t kGreen
Definition: RColor.hxx:179
ROOT::Experimental::RColor::kYellow
static constexpr R__DLLEXPORT RGB_t kYellow
Definition: RColor.hxx:192
TCanvas::Draw
void Draw(Option_t *option="") override
Draw a canvas.
Definition: TCanvas.cxx:843
ROOT::Experimental::RPave
Base class for paves with text, statistic, legends, placed relative to RFrame position and adjustable...
Definition: RPave.hxx:31
ROOT::Experimental
Definition: RDirectory.hxx:30
R__LOAD_LIBRARY
#define R__LOAD_LIBRARY(LIBRARY)
Definition: Rtypes.h:472