{ "cells": [ { "cell_type": "markdown", "id": "3ede8e52", "metadata": {}, "source": [ "# gr009_bent_err\n", "\n", "exl / exh: low and high (left/right) errors in x; similar for y\n", "e*d: delta, in axis units, to be added/subtracted (if >0 or <0) in x or y from\n", "the data point's position to use as end point of the corresponding error\n", "\n", "\n", "\n", "**Author:** Olivier Couet \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:37 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "18a1b648", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:52.299446Z", "iopub.status.busy": "2026-05-19T20:37:52.299309Z", "iopub.status.idle": "2026-05-19T20:37:52.667398Z", "shell.execute_reply": "2026-05-19T20:37:52.652452Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Info in : created default TCanvas with name c1\n" ] } ], "source": [ "const Int_t n = 10;\n", "Double_t x[n] = {-0.22, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95};\n", "Double_t y[n] = {1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};\n", "Double_t exl[n] = {.05,.1,.07,.07,.04,.05,.06,.07,.08,.05};\n", "Double_t eyl[n] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};\n", "Double_t exh[n] = {.02,.08,.05,.05,.03,.03,.04,.05,.06,.03};\n", "Double_t eyh[n] = {.6,.5,.4,.3,.2,.2,.3,.4,.5,.6};\n", "Double_t exld[n] = {.0,.0,.0,.0,.0,.0,.0,.0,.0,.0};\n", "Double_t eyld[n] = {.0,.0,.05,.0,.0,.0,.0,.0,.0,.0};\n", "Double_t exhd[n] = {.0,.0,.0,.0,.0,.0,.0,.0,.0,.0};\n", "Double_t eyhd[n] = {.0,.0,.0,.0,.0,.0,.0,.0,.05,.0};\n", "TGraphBentErrors *gr = new TGraphBentErrors(\n", " n,x,y,exl,exh,eyl,eyh,exld,exhd,eyld,eyhd);\n", "gr->SetTitle(\"TGraphBentErrors Example\");\n", "gr->SetMarkerColor(4);\n", "gr->SetMarkerStyle(21);\n", "gr->Draw(\"ALP\");" ] }, { "cell_type": "markdown", "id": "8c4bbc5f", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "9b3d7861", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:52.689422Z", "iopub.status.busy": "2026-05-19T20:37:52.689271Z", "iopub.status.idle": "2026-05-19T20:37:52.925438Z", "shell.execute_reply": "2026-05-19T20:37:52.924902Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%jsroot on\n", "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 }