In this example, the first angular sector (the one in blue) should go from 0° to 1° counter-clockwise starting from the x-axis, and its radius should be 6.39622E-02 (the circumference has radius 1).
The next sector, in yellow, should go from 1° to 2° and it’s radius should be 1.61721E-01.
So on till the last angular sector that should go from 90° to 180* with a radius of 1.93071E-03.
So you exploit error bars in order to draw the arcs.
I thank you for that, although it’s a bit ugly. Well… I’d like to have coloured sectors too.
I’ll wait for couet. I’ve no better idea at all.
Our TPies have a bug: they paint lines even when they’re not supposed to - I think because of a fill area miscalculation. That makes the result less nice - I’ll need @couet to have a look. But this is what I have for now:
void pies()
{
// theta upper bin borders:
std::array<double, 12> thetaBinBorders
= {0., 1., 2., 3., 4., 5., 10., 15., 30., 60., 90., 180.};
std::array<double, 11> prob
= {6.39622E-02, 1.61721E-01, 1.55263E-01, 1.25615E-01, 9.57030E-02, 2.21926E-01, 6.93081E-02, 6.31371E-02, 3.30873E-02, 8.34649E-03, 1.93071E-03};
// Pie values are the theta bin borders.
// Pie radii are the probabilities.
std::array<TPie*,11> pies{};
for (std::size_t i = 0; i < prob.size(); ++i) {
std::string name("pie");
name += std::to_string(i);
std::vector<float> vals;
int theSlice = 0;
if (i > 0) {
vals.emplace_back(thetaBinBorders[i]);
theSlice = 1;
}
vals.emplace_back(thetaBinBorders[i + 1] - thetaBinBorders[i]);
vals.emplace_back(360. - thetaBinBorders[i + 1]);
pies[i] = new TPie(name.c_str(), name.c_str(), vals.size(), vals.data());
for (int slice = 0; slice < vals.size(); ++slice) {
if (slice == theSlice)
pies[i]->SetEntryFillColor(slice, 20+i);
else {
pies[i]->SetEntryFillColor(slice, kWhite);
pies[i]->SetEntryFillStyle(slice, 4000);
}
}
pies[i]->SetRadius(prob[i]);
pies[i]->SetLabelFormat("");
if (i == 0)
pies[i]->Draw("nol");
else
pies[i]->Draw("nol SAME");
}
}