{ "cells": [ { "cell_type": "markdown", "id": "05af6523", "metadata": {}, "source": [ "# gr101_shade_area\n", "\n", "\n", "\n", "\n", "**Author:** Rene Brun \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:38 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "1871a04c", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:11.727667Z", "iopub.status.busy": "2026-05-19T20:38:11.727529Z", "iopub.status.idle": "2026-05-19T20:38:12.313184Z", "shell.execute_reply": "2026-05-19T20:38:12.312774Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "TCanvas *c1 = new TCanvas(\"c1\",\"A Simple Graph Example\",200,10,700,500);\n", "\n", "c1->SetGrid();\n", "c1->DrawFrame(0,0,2.2,12);\n", "\n", "const Int_t n = 20;\n", "Double_t x[n], y[n],ymin[n], ymax[n];\n", "Int_t i;\n", "for (i=0;iSetPoint(i,x[i],ymax[i]); \n", " grshade->SetPoint(n+i,x[n-i-1],ymin[n-i-1]);\n", "}\n", "grshade->SetFillStyle(3013);\n", "grshade->SetFillColor(16);\n", "grshade->Draw(\"f\"); //Draw the shaded area with \"f\" option (filled graph)\n", "grmin->Draw(\"l\");\n", "grmax->Draw(\"l\");\n", "gr->SetLineWidth(4);\n", "gr->SetMarkerColor(4);\n", "gr->SetMarkerStyle(21);\n", "gr->Draw(\"CP\");" ] }, { "cell_type": "markdown", "id": "af9879c9", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "f2c9ee99", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:12.315332Z", "iopub.status.busy": "2026-05-19T20:38:12.315210Z", "iopub.status.idle": "2026-05-19T20:38:12.527636Z", "shell.execute_reply": "2026-05-19T20:38:12.526957Z" } }, "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 }