26 typedef std::vector<Double_t> vector_type;
27 typedef vector_type::size_type size_type;
30 void create_flower(vector_type &xs, vector_type &ys, size_type nPoints,
Double_t r)
32 assert(nPoints > 100 &&
"create_flower, number of points is too small");
34 xs.resize(nPoints + 1);
35 ys.resize(nPoints + 1);
39 for (size_type i = 0; i <= nPoints; ++i) {
43 const Double_t rr = r * (1 +
TMath::Sin(11 * u / 5)) - 4 * p4 * p4 * p4 * p4 * p8 * p8 * p8 * p8 * p8 * p8 * p8 * p8;
57 ::Error(
"flower",
"failed to create custom colors");
62 TCanvas *
const cnv =
new TCanvas(
"Chrysanthemum",
"Chrysanthemum", 900, 900);
64 ::Error(
"flower",
"This macro requires OS X version of ROOT with cocoa enabled");
74 create_flower(xs, ys, 300, 6);
76 new TColor(indices[0], 0., 0., 0.5,
"custom_blue", 0.7);
81 create_flower(xs, ys, 500000, 8);
83 new TColor(indices[1], 0.5, 0., 0.5,
"custom_purple", 0.5);
88 create_flower(xs, ys, 100000, 10);
92 new TColor(indices[2], 1., 0., 0.4,
"custom_magenta", 0.2);
unsigned FindFreeCustomColorIndices(Color_t(&indices)[N])
virtual void SetName(const char *name)
Set the name of the TNamed.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
A TMultiGraph is a collection of TGraph (or derived) objects.
virtual void SetTitle(const char *title="")
Set graph title.
virtual void Draw(Option_t *chopt="")
Draw this multigraph with its current attributes.
void Error(const char *location, const char *msgfmt,...)
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
The color creation and management class.
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual void Add(TGraph *graph, Option_t *chopt="")
Add a new graph to the list of graphs.