This ROOT7 example demonstrates how to create a RCanvas and draw several RAxis objects with different options.
void draw_axes()
{
auto canvas = RCanvas::Create("RAxis examples");
auto x1 = 0.08_normal, w1 = 0.36_normal,
x2 = 0.57_normal, w2 = 0.36_normal;
draw4->
SetMinMax(
TDatime(2020,11,12,9,0,0).
Convert(),
TDatime(2020,11,12,12,0,0).
Convert())
.AttrAxis().SetTimeDisplay(
"%d/%m/%y %H:%M").SetTitle(
"time display").LabelsAttr().SetSize(0.01).SetColor(
RColor::kRed);
std::vector<std::string> labels = {"first", "second", "third", "forth", "fifth"};
canvas->SetSize(1000, 800);
canvas->Show();
}
static const double x2[5]
static const double x1[5]
#define R__LOAD_LIBRARY(LIBRARY)
RAttrAxis & SetEndingArrow()
RAttrAxis & SetLog(double base=10)
RAttrAxis & SetEndingSize(const RPadLength &sz)
RAttrAxis & SetTicksSize(const RPadLength &sz)
RAttrAxis & SetTitle(const std::string &title)
RAttrAxis & SetTitleLeft()
RAttrAxis & SetTicksInvert()
RAttrAxis & SetTicksColor(const RColor &color)
RAttrAxis & SetTicksBoth()
RAttrAxis & SetTitleCenter()
RAttrAxis & SetReverse(bool on=true)
RAttrAxis & SetLabelsCenter(bool on=true)
RAttrText & SetColor(const RColor &color)
The color of the text.
RAttrText & SetFont(int font)
Set text font by id as usually handled in the ROOT, set number between 1 and 15.
RAxisDrawable & SetMinMax(double min, double max)
RAxisLabelsDrawable & SetLabels(const std::vector< std::string > &lbls)
A position (horizontal and vertical) in a RPad.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.