{ "cells": [ { "cell_type": "markdown", "id": "cf06a70f", "metadata": {}, "source": [ "# logN\n", "Logarithmic scales support in web canvas.\n", "\n", "Shows support of log2, ln, log8 and log25 scales\n", "Any integer base for logarithm can be specified as well\n", "\n", "Functionality available only in web-based graphics\n", "\n", "\n", "\n", "\n", "**Author:** Sergey Linev \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": "f95064db", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:39:02.673518Z", "iopub.status.busy": "2026-05-19T20:39:02.673394Z", "iopub.status.idle": "2026-05-19T20:39:03.211114Z", "shell.execute_reply": "2026-05-19T20:39:03.210471Z" } }, "outputs": [], "source": [ "auto h1 = new TH1I(\"hist\", \"Random data\", 100, -5, 5);\n", "h1->FillRandom(\"gaus\", 10000);\n", "\n", "auto c1 = new TCanvas(\"c1\", \"Logarithmic scales\", 1200, 800);\n", "\n", "if (!gROOT->IsBatch() && !c1->IsWeb())\n", " ::Warning(\"logN.cxx\", \"macro will not work without enabling web-based canvas\");\n", "\n", "c1->Divide(2, 2);\n", "\n", "c1->GetPad(1)->SetLogy(2); // configure log2\n", "c1->GetPad(1)->Add(h1, \"\"); // draw with default draw option\n", "\n", "c1->GetPad(2)->SetLogy(3); // configure ln - 3 is special case\n", "c1->GetPad(2)->Add(h1, \"l\"); // draw histogram as line\n", "\n", "c1->GetPad(3)->SetLogy(8); // configure log8\n", "c1->GetPad(3)->Add(h1, \"c\"); // draw histogram as curve\n", "\n", "c1->GetPad(4)->SetLogy(25); // configure log25\n", "c1->GetPad(4)->Add(h1, \"E\"); // draw histogram as errors" ] }, { "cell_type": "markdown", "id": "cdd72de3", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "5ad17cf4", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:39:03.213193Z", "iopub.status.busy": "2026-05-19T20:39:03.213068Z", "iopub.status.idle": "2026-05-19T20:39:03.450354Z", "shell.execute_reply": "2026-05-19T20:39:03.449722Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "