{ "cells": [ { "cell_type": "markdown", "id": "2922e049", "metadata": {}, "source": [ "# gr102_reverse_graph\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": "1719fffe", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:12.380111Z", "iopub.status.busy": "2026-05-19T20:38:12.379989Z", "iopub.status.idle": "2026-05-19T20:38:12.855434Z", "shell.execute_reply": "2026-05-19T20:38:12.854662Z" } }, "outputs": [], "source": [ "auto c = new TCanvas(\"c\",\"Reversed graphs\",0,0,900,400);\n", "c->Divide(2,1); //Create a canvas with a 2x1 grid layout\n", "\n", "auto gr = new TGraph();\n", "gr->GetXaxis()->SetNdivisions(514);\n", "gr->GetYaxis()->SetNdivisions(514);\n", "gr->SetMarkerStyle(kCircle);\n", "gr->SetMarkerColor(kBlue);\n", "gr->SetLineColor(kRed);\n", "gr->SetPoint(0,5,5);\n", "gr->SetPoint(1,9,9);\n", "gr->SetPoint(2,14,14);\n", "\n", "\n", "c->cd(1);\n", "gPad->SetGrid();\n", "gr->Draw(\"a pl \"); //Plot with axis (\"a\") and line+points (\"pl\")\n", "\n", "c->cd(2);\n", "gPad->SetGrid();\n", "gr->Draw(\"a pl rx ry \"); //Plot with axis (\"a\") and line+points (\"pl\") with reverse X and Y axes" ] }, { "cell_type": "markdown", "id": "6b2b1fb8", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "0dfd8f43", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:12.857232Z", "iopub.status.busy": "2026-05-19T20:38:12.857111Z", "iopub.status.idle": "2026-05-19T20:38:13.068951Z", "shell.execute_reply": "2026-05-19T20:38:13.068245Z" } }, "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 }