{ "cells": [ { "cell_type": "markdown", "id": "55e3e434", "metadata": {}, "source": [ "# gaxis2\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:37 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "41b5dbbd", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:06.405710Z", "iopub.status.busy": "2026-05-19T20:37:06.405582Z", "iopub.status.idle": "2026-05-19T20:37:06.901301Z", "shell.execute_reply": "2026-05-19T20:37:06.900635Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Info in : created default TCanvas with name c1\n" ] } ], "source": [ "gStyle->SetOptStat(0);\n", "\n", "TH2F *h2 = new TH2F(\"h\", \"Axes\", 100, 0, 10, 100, -2, 2);\n", "h2->Draw();\n", "\n", "TF1 *f1 = new TF1(\"f1\", \"-x\", -10, 10);\n", "TGaxis *A1 = new TGaxis(0, 2, 10, 2, \"f1\", 510, \"-\");\n", "A1->SetTitle(\"axis with decreasing values\");\n", "A1->Draw();\n", "\n", "TF1 *f2 = new TF1(\"f2\", \"exp(x)\", 0, 2);\n", "TGaxis *A2 = new TGaxis(1, 1, 9, 1, \"f2\");\n", "A2->SetTitle(\"exponential axis\");\n", "A2->SetLabelSize(0.03);\n", "A2->SetTitleSize(0.03);\n", "A2->SetTitleOffset(1.2);\n", "A2->Draw();\n", "\n", "TF1 *f3 = new TF1(\"f3\", \"log10(x)\", 1, 1000);\n", "TGaxis *A3 = new TGaxis(2, -2, 2, 0, \"f3\", 505, \"G\");\n", "A3->SetTitle(\"logarithmic axis\");\n", "A3->SetLabelSize(0.03);\n", "A3->SetTitleSize(0.03);\n", "A3->SetTitleOffset(1.2);\n", "A3->Draw();" ] }, { "cell_type": "markdown", "id": "e9d96b0e", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "8b09ae43", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:06.903253Z", "iopub.status.busy": "2026-05-19T20:37:06.903127Z", "iopub.status.idle": "2026-05-19T20:37:07.130038Z", "shell.execute_reply": "2026-05-19T20:37:07.129380Z" } }, "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 }