{ "cells": [ { "cell_type": "markdown", "id": "b4d7c909", "metadata": {}, "source": [ "# pdf002_2d_pdf\n", "Example macro showing some major probability density functions in ROOT.\n", "The macro shows four of them with\n", "respect to their two variables. In order to run the macro type:\n", "\n", "```cpp\n", " root [0] .x mathcoreStatFunc.C\n", "```\n", "\n", "\n", "\n", "\n", "**Author:** Andras Zsenei \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:26 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "93adffc1", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:26:30.799195Z", "iopub.status.busy": "2026-05-19T20:26:30.799086Z", "iopub.status.idle": "2026-05-19T20:26:31.142299Z", "shell.execute_reply": "2026-05-19T20:26:31.141574Z" } }, "outputs": [], "source": [ "TF2 *f1a = new TF2(\"f1a\",\"ROOT::Math::cauchy_pdf(x, y)\",0,10,0,10);\n", "TF2 *f2a = new TF2(\"f2a\",\"ROOT::Math::chisquared_pdf(x,y)\",0,20, 0,20);\n", "TF2 *f3a = new TF2(\"f3a\",\"ROOT::Math::gaussian_pdf(x,y)\",0,10,0,5);\n", "TF2 *f4a = new TF2(\"f4a\",\"ROOT::Math::tdistribution_pdf(x,y)\",0,10,0,5);\n", "\n", "TCanvas *c1 = new TCanvas(\"c1\",\"c1\",800,650);\n", "\n", "c1->Divide(2,2);\n", "\n", "c1->cd(1); f1a->SetLineWidth(1);\n", "f1a->Draw(\"surf1\");\n", "c1->cd(2); f2a->SetLineWidth(1);\n", "f2a->Draw(\"surf1\");\n", "c1->cd(3); f3a->SetLineWidth(1);\n", "f3a->Draw(\"surf1\");\n", "c1->cd(4); f4a->SetLineWidth(1);\n", "f4a->Draw(\"surf1\");" ] }, { "cell_type": "markdown", "id": "4a18fe37", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "52c903fc", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:26:31.144359Z", "iopub.status.busy": "2026-05-19T20:26:31.144238Z", "iopub.status.idle": "2026-05-19T20:26:31.460954Z", "shell.execute_reply": "2026-05-19T20:26:31.460286Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "