{ "cells": [ { "cell_type": "markdown", "id": "584079ad", "metadata": {}, "source": [ "# gaxis\n", "\n", "\n", "\n", "\n", "**Author:** Rene Brun, 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": "f7e8fd90", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:06.279859Z", "iopub.status.busy": "2026-05-19T20:37:06.279720Z", "iopub.status.idle": "2026-05-19T20:37:06.625742Z", "shell.execute_reply": "2026-05-19T20:37:06.625054Z" } }, "outputs": [], "source": [ "auto c1 = new TCanvas(\"c1\", \"Examples of TGaxis\", 10, 10, 700, 500);\n", "c1->Range(-10, -1, 10, 1);\n", "\n", "auto axis1 = new TGaxis(-4.5, -0.2, 5.5, -0.2, -6, 8, 510, \"\");\n", "axis1->Draw();\n", "\n", "auto axis2 = new TGaxis(-4.5, 0.2, 5.5, 0.2, 0.001, 10000, 510, \"G\");\n", "axis2->Draw();\n", "\n", "auto axis3 = new TGaxis(-9, -0.8, -9, 0.8, -8, 8, 50510, \"\");\n", "axis3->SetTitle(\"axis3\");\n", "axis3->SetTitleOffset(0.5);\n", "axis3->Draw();\n", "\n", "auto axis4 = new TGaxis(-7, -0.8, -7, 0.8, 1, 10000, 50510, \"G\");\n", "axis4->SetTitle(\"axis4\");\n", "axis4->Draw();\n", "\n", "auto axis5 = new TGaxis(-4.5, -0.6, 5.5, -0.6, 1.2, 1.32, 80506, \"-+\");\n", "axis5->SetLabelSize(0.03);\n", "axis5->SetTextFont(72);\n", "axis5->Draw();\n", "\n", "auto axis6 = new TGaxis(-4.5, 0.5, 5.5, 0.5, 100, 900, 50510, \"-\");\n", "axis6->Draw();\n", "\n", "auto axis7 = new TGaxis(-5.5, 0.85, 5.5, 0.85, 0, 4.3e-6, 510, \"\");\n", "axis7->Draw();\n", "\n", "auto axis8 = new TGaxis(8, -0.8, 8, 0.8, 0, 9000, 50510, \"+L\");\n", "axis8->Draw();" ] }, { "cell_type": "markdown", "id": "2b182af2", "metadata": {}, "source": [ "One can make a vertical axis going top->bottom.\n", "However one need to adjust labels align to avoid overlapping." ] }, { "cell_type": "code", "execution_count": 2, "id": "4eab8667", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:06.627303Z", "iopub.status.busy": "2026-05-19T20:37:06.627181Z", "iopub.status.idle": "2026-05-19T20:37:06.844074Z", "shell.execute_reply": "2026-05-19T20:37:06.843361Z" } }, "outputs": [], "source": [ "auto axis9 = new TGaxis(6.5, 0.8, 6.5, -0.8, 0, 90, 50510, \"-L\");\n", "axis9->Draw();" ] }, { "cell_type": "markdown", "id": "31c28dee", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 3, "id": "643c9de9", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:06.845645Z", "iopub.status.busy": "2026-05-19T20:37:06.845513Z", "iopub.status.idle": "2026-05-19T20:37:07.056823Z", "shell.execute_reply": "2026-05-19T20:37:07.055750Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "