{ "cells": [ { "cell_type": "markdown", "id": "7f0b0ad2", "metadata": {}, "source": [ "# hist050_Graphics_candle_plot_options\n", "\n", "\n", "\n", "\n", "**Author:** Georg Troska \n", "This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, May 19, 2026 at 08:13 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "fedb53f8", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:04.246786Z", "iopub.status.busy": "2026-05-19T20:13:04.246678Z", "iopub.status.idle": "2026-05-19T20:13:04.593028Z", "shell.execute_reply": "2026-05-19T20:13:04.592274Z" } }, "outputs": [], "source": [ "TCanvas *c1 = new TCanvas(\"c1\", \"Candle Presets\", 800, 600);\n", "c1->Divide(3, 2);\n", "\n", "TRandom *rng = new TRandom();\n", "TH2I *h1 = new TH2I(\"h1\", \"Sin\", 18, 0, 360, 300, -1.5, 1.5);\n", "h1->GetXaxis()->SetTitle(\"Deg\");\n", "float myRand;\n", "for (int i = 0; i < 360; i += 10) {\n", " for (int j = 0; j < 100; j++) {\n", " myRand = rng->Gaus(sin(i * 3.14 / 180), 0.2);\n", " h1->Fill(i, myRand);\n", " }\n", "}\n", "for (int i = 1; i < 7; i++) {\n", " c1->cd(i);\n", " TString str = TString::Format(\"candlex%d\", i);\n", " TH2I *myhist = (TH2I *)h1->DrawCopy(str);\n", " myhist->SetTitle(str);\n", "}\n", "\n", "TCanvas *c2 = new TCanvas(\"c2\", \"Candle Individual\", 800, 600);\n", "c2->Divide(4, 4);\n", "char myopt[16][8] = {\"0\", \"1\", \"11\", \"21\", \"31\", \"30\", \"111\", \"311\",\n", " \"301\", \"1111\", \"2321\", \"12111\", \"112111\", \"212111\", \"312111\"};\n", "for (int i = 0; i < 15; i++) {\n", " c2->cd(i + 1);\n", " TString str = TString::Format(\"candlex(%s)\", myopt[i]);\n", " TH2I *myhist = (TH2I *)h1->DrawCopy(str);\n", " myhist->SetTitle(str);\n", "}" ] }, { "cell_type": "markdown", "id": "24f23262", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "6ead9b4f", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:04.595203Z", "iopub.status.busy": "2026-05-19T20:13:04.595074Z", "iopub.status.idle": "2026-05-19T20:13:04.800851Z", "shell.execute_reply": "2026-05-19T20:13:04.800152Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gROOT->GetListOfCanvases()->Draw()" ] } ], "metadata": { "kernelspec": { "display_name": "ROOT C++", "language": "c++", "name": "root" }, "language_info": { "codemirror_mode": "text/x-c++src", "file_extension": ".C", "mimetype": " text/x-c++src", "name": "c++" } }, "nbformat": 4, "nbformat_minor": 5 }