{ "cells": [ { "cell_type": "markdown", "id": "ef292b83", "metadata": {}, "source": [ "# earth\n", "\n", " - \"AITOFF\" : Draw a contour via an AITOFF projection\n", " - \"MERCATOR\" : Draw a contour via an Mercator projection\n", " - \"SINUSOIDAL\" : Draw a contour via an Sinusoidal projection\n", " - \"PARABOLIC\" : Draw a contour via an Parabolic projection\n", " - \"MOLLWEIDE\" : Draw a contour via an Mollweide projection\n", "\n", "\n", "\n", "\n", "**Author:** Olivier Couet (from an original macro sent by Ernst-Jan Buis) \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:36 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "9415c7de", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:36:56.859431Z", "iopub.status.busy": "2026-05-19T20:36:56.859287Z", "iopub.status.idle": "2026-05-19T20:36:57.339055Z", "shell.execute_reply": "2026-05-19T20:36:57.337877Z" } }, "outputs": [], "source": [ "gStyle->SetOptTitle(1);\n", "gStyle->SetOptStat(0);\n", "\n", "TCanvas *c1 = new TCanvas(\"c1\", \"earth_projections\", 700, 1000);\n", "c1->Divide(2, 3);\n", "\n", "TH2F *ha = new TH2F(\"ha\", \"Aitoff\", 180, -180, 180, 179, -89.5, 89.5);\n", "TH2F *hm = new TH2F(\"hm\", \"Mercator\", 180, -180, 180, 161, -80.5, 80.5);\n", "TH2F *hs = new TH2F(\"hs\", \"Sinusoidal\", 180, -180, 180, 181, -90.5, 90.5);\n", "TH2F *hp = new TH2F(\"hp\", \"Parabolic\", 180, -180, 180, 181, -90.5, 90.5);\n", "TH2F *hw = new TH2F(\"hw\", \"Mollweide\", 180, -180, 180, 181, -90.5, 90.5);\n", "\n", "TString dat = gROOT->GetTutorialDir();\n", "dat.Append(\"/visualisation/graphics/earth.dat\");\n", "dat.ReplaceAll(\"/./\", \"/\");\n", "\n", "ifstream in;\n", "in.open(dat.Data());\n", "Float_t x, y;\n", "while (1) {\n", " in >> x >> y;\n", " if (!in.good())\n", " break;\n", " ha->Fill(x, y, 1);\n", " hm->Fill(x, y, 1);\n", " hs->Fill(x, y, 1);\n", " hp->Fill(x, y, 1);\n", " hw->Fill(x, y, 1);\n", "}\n", "in.close();\n", "\n", "c1->cd(1);\n", "ha->Draw(\"aitoff\");\n", "c1->cd(2);\n", "hm->Draw(\"mercator\");\n", "c1->cd(3);\n", "hs->Draw(\"sinusoidal\");\n", "c1->cd(4);\n", "hp->Draw(\"parabolic\");\n", "c1->cd(5);\n", "hw->Draw(\"mollweide\");\n", "\n", "return c1;" ] }, { "cell_type": "markdown", "id": "fc90a2b3", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "e44cc5d4", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:36:57.340765Z", "iopub.status.busy": "2026-05-19T20:36:57.340628Z", "iopub.status.idle": "2026-05-19T20:37:00.295223Z", "shell.execute_reply": "2026-05-19T20:37:00.294665Z" } }, "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 }