{ "cells": [ { "cell_type": "markdown", "id": "7ebe3b2a", "metadata": {}, "source": [ "# gr112_reverse_graph_and_errors\n", "\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:38 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "f2926319", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:28.468915Z", "iopub.status.busy": "2026-05-19T20:38:28.468802Z", "iopub.status.idle": "2026-05-19T20:38:28.816968Z", "shell.execute_reply": "2026-05-19T20:38:28.816298Z" } }, "outputs": [], "source": [ "auto c = new TCanvas(\"c\",\"Reversed graphs\",0,0,900,900);\n", "c->Divide(3,3);" ] }, { "cell_type": "markdown", "id": "f367b986", "metadata": {}, "source": [ "TGraphErrors (first row example)" ] }, { "cell_type": "code", "execution_count": 2, "id": "5191d3dd", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:28.818996Z", "iopub.status.busy": "2026-05-19T20:38:28.818877Z", "iopub.status.idle": "2026-05-19T20:38:29.026342Z", "shell.execute_reply": "2026-05-19T20:38:29.025695Z" } }, "outputs": [], "source": [ "auto graphe = new TGraphErrors();\n", "graphe->GetXaxis()->SetNdivisions(514);\n", "graphe->GetYaxis()->SetNdivisions(514);\n", "graphe->SetMarkerStyle(kCircle);\n", "graphe->SetPoint(0,5,5);\n", "graphe->SetPointError(0,1,3);\n", "graphe->SetPoint(1,9,9);\n", "graphe->SetPointError(1,1,3);\n", "\n", "c->cd(1);\n", "gPad->SetGrid();\n", "graphe->Draw(\"a pl \"); //Plot with axis (\"a\") and line+points (\"pl\")\n", "\n", "c->cd(2);\n", "gPad->SetGrid();\n", "graphe->Draw(\"a pl rx ry \"); //Plot with axis (\"a\") and line+points (\"pl\") with reverse X and Y axes\n", "\n", "c->cd(3);\n", "gPad->SetGrid();\n", "gPad->SetLogx();\n", "gPad->SetLogy();\n", "graphe->GetXaxis()->SetMoreLogLabels();\n", "graphe->GetYaxis()->SetMoreLogLabels();\n", "graphe->Draw(\"a pl rx ry\"); //Plot with reverse axis and log scale" ] }, { "cell_type": "markdown", "id": "1e063ad5", "metadata": {}, "source": [ "TGraphAsymmErrors (second row example)" ] }, { "cell_type": "code", "execution_count": 3, "id": "c3144283", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:29.031359Z", "iopub.status.busy": "2026-05-19T20:38:29.031243Z", "iopub.status.idle": "2026-05-19T20:38:29.252874Z", "shell.execute_reply": "2026-05-19T20:38:29.241644Z" } }, "outputs": [], "source": [ "auto graphae = new TGraphAsymmErrors();\n", "graphae->GetXaxis()->SetNdivisions(514);\n", "graphae->GetYaxis()->SetNdivisions(514);\n", "graphae->SetMarkerStyle(kCircle);\n", "graphae->SetPoint(0,5,5);\n", "graphae->SetPointError(0,1,3,3,1);\n", "graphae->SetPoint(1,9,9);\n", "graphae->SetPointError(1,1,3,1,3);\n", "\n", "c->cd(4);\n", "gPad->SetGrid();\n", "graphae->Draw(\"a pl \");\n", "\n", "c->cd(5);\n", "gPad->SetGrid();\n", "graphae->Draw(\"a pl rx ry \");\n", "\n", "c->cd(6);\n", "gPad->SetGrid();\n", "gPad->SetLogx();\n", "gPad->SetLogy();\n", "graphae->GetXaxis()->SetMoreLogLabels();\n", "graphae->GetYaxis()->SetMoreLogLabels();\n", "graphae->Draw(\"a pl rx ry\");" ] }, { "cell_type": "markdown", "id": "dd5ebc6c", "metadata": {}, "source": [ "TGraphBentErrors (third row example)" ] }, { "cell_type": "code", "execution_count": 4, "id": "3b1fdbfa", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:29.260759Z", "iopub.status.busy": "2026-05-19T20:38:29.260574Z", "iopub.status.idle": "2026-05-19T20:38:29.473364Z", "shell.execute_reply": "2026-05-19T20:38:29.472729Z" } }, "outputs": [], "source": [ "auto graphbe = new TGraphBentErrors();\n", "graphbe->GetXaxis()->SetNdivisions(514);\n", "graphbe->GetYaxis()->SetNdivisions(514);\n", "graphbe->SetMarkerStyle(kCircle);\n", "graphbe->SetPoint(0,5,5);\n", "graphbe->SetPointError(0,1,3,3,1,.5,.2,.5,.2);\n", "graphbe->SetPoint(1,9,9);\n", "graphbe->SetPointError(1,1,3,1,3,-.5,-.2,-.5,-.2);\n", "\n", "c->cd(7);\n", "gPad->SetGrid();\n", "graphbe->Draw(\"a pl \");\n", "\n", "c->cd(8);\n", "gPad->SetGrid();\n", "graphbe->Draw(\"a pl rx ry \");\n", "\n", "c->cd(9);\n", "gPad->SetGrid();\n", "gPad->SetLogx();\n", "gPad->SetLogy();\n", "graphbe->GetXaxis()->SetMoreLogLabels();\n", "graphbe->GetYaxis()->SetMoreLogLabels();\n", "graphbe->Draw(\"a pl rx ry\");" ] }, { "cell_type": "markdown", "id": "09e125a6", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 5, "id": "0535167d", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:29.476288Z", "iopub.status.busy": "2026-05-19T20:38:29.476159Z", "iopub.status.idle": "2026-05-19T20:38:29.712690Z", "shell.execute_reply": "2026-05-19T20:38:29.710439Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "