This ROOT7 example demonstrates how to create a RCanvas and draw several RAxis objects with different options.
void raxis()
{
auto canvas = RCanvas::Create("RAxis examples");
auto x1 = 0.08_normal, w1 = 0.36_normal,
x2 = 0.57_normal, w2 = 0.36_normal;
draw0->axis.ticks.size = 0.02_normal;
draw0->axis.title = "vertical";
draw2->axis.ticks.size = 0.02_normal;
draw2->axis.title = "both side ticks";
draw2->axis.title.SetCenter();
draw3->axis.labels.center = true;
draw4->axis.SetTimeDisplay("%d/%m/%y %H:%M");
draw4->axis.title = "time display";
draw4->axis.labels.size = 0.01;
draw4->axis.labels.color = RColor::kRed;
std::vector<std::string> labels = {"first", "second", "third", "forth", "fifth"};
draw5->axis.title = "labels, swap ticks side";
draw5->axis.title.SetLeft();
draw6->axis.max = 10;
draw6->axis.ending.SetArrow();
draw6->axis.title = "vertical negative length";
draw7->axis.max = 100;
draw7->axis.log = 10;
draw7->axis.title = "log10 scale";
draw7->axis.title.SetCenter();
draw7->axis.title.font = RAttrFont::kVerdana;
draw7->axis.title.color = RColor::kGreen;
draw7->axis.ending.SetCircle();
draw8->axis.max = 128;
draw8->axis.log = 2;
draw8->axis.title = "log2 scale";
draw8->axis.title.SetCenter();
draw9->axis.max = 100;
draw9->axis.log = 2.7182;
draw9->axis.title = "ln scale";
draw9->axis.title.SetCenter();
draw10->axis.title = "horizontal negative length";
draw10->axis.title.SetCenter();
draw11->axis.reverse = true;
draw11->axis.title = "horizontal reverse";
draw11->axis.title.SetCenter();
draw12->axis.ending.size = 0.01_normal;
draw12->axis.ticks.SetBoth();
draw12->axis.ticks.color = RColor::kBlue;
draw12->axis.ticks.size = 0.01_normal;
draw12->axis.title = "vertical axis with arrow";
draw12->axis.title.SetCenter();
canvas->SetSize(1000, 800);
canvas->Show();
}
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
RAttrAxisTicks ticks
! ticks attributes
RAttrAxisTitle title
! title attributes
RAttrLineEnding ending
! ending attributes
RAttrValue< double > min
! axis min
RAttrAxis axis
! axis attributes
RAxisDrawable & 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.