{ "cells": [ { "cell_type": "markdown", "id": "6399cea1", "metadata": {}, "source": [ "# gr014_polar3\n", "See the [TGraphPolar documentation](https://root.cern/doc/master/classTGraphPolar.html)\n", "\n", "Since TGraphPolar is a TGraphErrors, it is painted with\n", "[TGraphPainter](https://root.cern/doc/master/classTGraphPainter.html) options.\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": "2fa449e9", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:03.776200Z", "iopub.status.busy": "2026-05-19T20:38:03.776057Z", "iopub.status.idle": "2026-05-19T20:38:04.257187Z", "shell.execute_reply": "2026-05-19T20:38:04.256680Z" } }, "outputs": [], "source": [ "TCanvas *CPol = new TCanvas(\"CPol\",\"TGraphPolar Examples\",500,500);\n", "\n", "Double_t rmin = 0;\n", "Double_t rmax = TMath::Pi()*2;\n", "Double_t r[1000];\n", "Double_t theta[1000];\n", "\n", "TF1 *fp1 = new TF1(\"fplot\",\"cos(x)\",rmin,rmax);\n", "for (Int_t ipt = 0; ipt < 1000; ipt++) {\n", " r[ipt] = ipt*(rmax-rmin)/1000+rmin;\n", " theta[ipt] = fp1->Eval(r[ipt]);\n", "}\n", "\n", "TGraphPolar *grP1 = new TGraphPolar(1000, r, theta);\n", "grP1->SetTitle(\"\");\n", "grP1->SetLineColor(2);\n", "grP1->Draw(\"AOL\");" ] }, { "cell_type": "markdown", "id": "30390b15", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "4d1164fc", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:04.268393Z", "iopub.status.busy": "2026-05-19T20:38:04.268254Z", "iopub.status.idle": "2026-05-19T20:38:04.480400Z", "shell.execute_reply": "2026-05-19T20:38:04.479710Z" } }, "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 }