{ "cells": [ { "cell_type": "markdown", "id": "38614751", "metadata": {}, "source": [ "# hist053_Graphics_candle_scaled\n", "Please try to modify the static functions SetScaledCandle and SetScaledViolin\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": "c2867a4a", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:07.400857Z", "iopub.status.busy": "2026-05-19T20:13:07.400746Z", "iopub.status.idle": "2026-05-19T20:13:07.850371Z", "shell.execute_reply": "2026-05-19T20:13:07.849723Z" } }, "outputs": [], "source": [ "TCanvas *c1 = new TCanvas(\"c1\", \"TCandle Scaled\", 800, 600);\n", "c1->Divide(2, 2);\n", "TH2I *h1 = new TH2I(\"h1\", \"GausXY\", 20, -5, 5, 100, -5, 5);\n", "TH2I *h3 = new TH2I(\"h3\", \"GausXY\", 100, -5, 5, 20, -5, 5);\n", "\n", "for (int j = 0; j < 100000; j++) {\n", " auto myRand1 = gRandom->Gaus(0, 1);\n", " auto myRand2 = gRandom->Gaus(0, 1);\n", " h1->Fill(myRand1, myRand2);\n", " h3->Fill(myRand1, myRand2);\n", "}\n", "\n", "c1->cd(1);\n", "\n", "TCandle::SetScaledCandle(true); /* This is a global option for all existing candles, default is false */\n", "\n", "h1->SetTitle(\"CandleX scaled\");\n", "h1->DrawCopy(\"candleX2\");\n", "c1->cd(2);\n", "\n", "h3->SetTitle(\"CandleY scaled\");\n", "h3->DrawCopy(\"candleY2\");\n", "\n", "TCandle::SetScaledViolin(false); /* This is a global option for all existing violin, default is true */\n", "TH2I *h2 = (TH2I *)h1->Clone();\n", "h2->SetFillStyle(0);\n", "h2->SetFillColor(kGray + 2);\n", "h2->SetLineColor(kBlue);\n", "TH2I *h4 = (TH2I *)h3->Clone();\n", "h4->SetFillStyle(0);\n", "h4->SetFillColor(kGray + 2);\n", "h4->SetLineColor(kBlue);\n", "\n", "c1->cd(3);\n", "h2->SetTitle(\"ViolinX unscaled\");\n", "h2->DrawCopy(\"ViolinX\");\n", "c1->cd(4);\n", "h4->SetTitle(\"ViolinY unscaled\");\n", "h4->DrawCopy(\"ViolinY\");" ] }, { "cell_type": "markdown", "id": "bf8c19eb", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "793a6f69", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:13:07.852279Z", "iopub.status.busy": "2026-05-19T20:13:07.852157Z", "iopub.status.idle": "2026-05-19T20:13:08.056576Z", "shell.execute_reply": "2026-05-19T20:13:08.055866Z" } }, "outputs": [ { "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 }