{ "cells": [ { "cell_type": "markdown", "id": "279580fd", "metadata": {}, "source": [ "# markerwarning\n", "\n", "\n", "Non-symmetric symbols should be used carefully in plotting.\n", "These two graphs show how misleading a careless use of symbols can be.\n", "The two plots represent the same data sets but because of a bad symbol\n", "choice, the two plots on the top appear further apart than for the bottom\n", "example.\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": "8c6f8ccd", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:18.376275Z", "iopub.status.busy": "2026-05-19T20:37:18.376133Z", "iopub.status.idle": "2026-05-19T20:37:18.835194Z", "shell.execute_reply": "2026-05-19T20:37:18.834635Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "const int Nph = 14;\n", "double np_ph[Nph] = {353.4, 300.2, 254.3, 215.2, 181.0, 151.3, 125.2, 102.7, 83.3, 66.7, 52.5, 40.2, 30.2, 22.0};\n", "double nc_ph[Nph] = {3.890, 3.734, 3.592, 3.453, 3.342, 3.247, 3.151,\n", " 3.047, 2.965, 2.858, 2.701, 2.599, 2.486, 2.328};\n", "double npe_ph[Nph] = {10.068, 9.004, 8.086, 7.304, 6.620, 6.026, 5.504,\n", " 5.054, 4.666, 4.334, 4.050, 3.804, 3.604, 3.440};\n", "double nce_ph[Nph] = {0.235, 0.217, 0.210, 0.206, 0.213, 0.223, 0.239,\n", " 0.260, 0.283, 0.318, 0.356, 0.405, 0.465, 0.545};\n", "\n", "const int Nbr = 6;\n", "double np_br[Nbr] = {357.0, 306.0, 239.0, 168.0, 114.0, 73.0};\n", "double nc_br[Nbr] = {3.501, 3.275, 3.155, 3.060, 3.053, 3.014};\n", "double npe_br[Nbr] = {8.000, 11.000, 10.000, 9.000, 9.000, 8.000};\n", "double nce_br[Nbr] = {0.318, 0.311, 0.306, 0.319, 0.370, 0.429};\n", "\n", "TGraphErrors *phUP = new TGraphErrors(Nph, np_ph, nc_ph, npe_ph, nce_ph);\n", "TGraphErrors *phDN = new TGraphErrors(Nph, np_ph, nc_ph, npe_ph, nce_ph);\n", "TGraphErrors *brUP = new TGraphErrors(Nbr, np_br, nc_br, npe_br, nce_br);\n", "TGraphErrors *brDN = new TGraphErrors(Nbr, np_br, nc_br, npe_br, nce_br);\n", "\n", "float Top_margin = 0.;\n", "float Left_margin = 0.025;\n", "float Right_margin = 0.005;\n", "float maxPlotPart = 395;\n", "float Marker_Size = 1.3;\n", "int Marker_Style = 8;\n", "\n", "float Et_200_Min = 0.71;\n", "float Et_200_Max = 3.80;\n", "float Et_130_Min = 1.21;\n", "float Et_130_Max = 3.29;\n", "\n", "float Nc_200_Min = 1.31;\n", "float Nc_200_Max = 4.30;\n", "float Nc_130_Min = 1.51;\n", "float Nc_130_Max = 3.89;\n", "\n", "TCanvas *canvasNc = new TCanvas(\"canvasNc\", \"Multiplicity\", 630, 10, 600, 500);\n", "\n", "gStyle->SetOptStat(0);\n", "canvasNc->SetFillColor(10);\n", "canvasNc->SetBorderSize(0);" ] }, { "cell_type": "markdown", "id": "df640521", "metadata": {}, "source": [ "Primitives in Nc200 pad" ] }, { "cell_type": "code", "execution_count": 2, "id": "b4b8cff2", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:18.837120Z", "iopub.status.busy": "2026-05-19T20:37:18.837005Z", "iopub.status.idle": "2026-05-19T20:37:19.064923Z", "shell.execute_reply": "2026-05-19T20:37:19.056644Z" } }, "outputs": [], "source": [ "TPad *padNcUP = new TPad(\"padNcUP\", \"200 GeV\", 0.07, 0.60, 1., 1.00);\n", "padNcUP->Draw();\n", "padNcUP->cd();\n", "padNcUP->SetFillColor(10);\n", "padNcUP->SetFrameFillColor(10);\n", "padNcUP->SetBorderSize(0);\n", "padNcUP->SetLeftMargin(Left_margin);\n", "padNcUP->SetRightMargin(Right_margin);\n", "padNcUP->SetTopMargin(Top_margin + 0.005);\n", "padNcUP->SetBottomMargin(0.00);\n", "\n", "TH1F *frameNcUP = new TH1F(\"frameNcUP\", \"\", 100, 0, maxPlotPart);\n", "frameNcUP->GetYaxis()->SetLabelOffset(0.005);\n", "frameNcUP->GetYaxis()->SetLabelSize(0.10);\n", "frameNcUP->SetMinimum(Nc_200_Min);\n", "frameNcUP->SetMaximum(Nc_200_Max);\n", "frameNcUP->SetNdivisions(505, \"Y\");\n", "frameNcUP->SetNdivisions(505, \"X\");\n", "frameNcUP->Draw();\n", "\n", "brUP->SetMarkerStyle(22);\n", "brUP->SetMarkerSize(2.0);\n", "brUP->Draw(\"P\");\n", "\n", "phDN->SetMarkerStyle(23);\n", "phDN->SetMarkerSize(2);\n", "phDN->Draw(\"P\");\n", "\n", "canvasNc->cd();" ] }, { "cell_type": "markdown", "id": "400dcce8", "metadata": {}, "source": [ "Primitives in Nc130 pad" ] }, { "cell_type": "code", "execution_count": 3, "id": "eb65459e", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:19.083704Z", "iopub.status.busy": "2026-05-19T20:37:19.083545Z", "iopub.status.idle": "2026-05-19T20:37:19.294128Z", "shell.execute_reply": "2026-05-19T20:37:19.293645Z" } }, "outputs": [], "source": [ "TPad *padNcDN = new TPad(\"padNcDN\", \"130 GeV\", 0.07, 0.02, 1., 0.60);\n", "padNcDN->Draw();\n", "padNcDN->cd();\n", "padNcDN->SetFillColor(10);\n", "padNcDN->SetFrameFillColor(10);\n", "padNcDN->SetBorderSize(0);\n", "padNcDN->SetLeftMargin(Left_margin);\n", "padNcDN->SetRightMargin(Right_margin);\n", "padNcDN->SetTopMargin(Top_margin + 0.005);\n", "padNcDN->SetBottomMargin(0.30);\n", "\n", "TH1F *frameNcDN = new TH1F(\"frameNcDN\", \"\", 100, 0, maxPlotPart);\n", "frameNcDN->GetYaxis()->SetLabelOffset(0.005);\n", "frameNcDN->GetYaxis()->SetLabelSize(0.07);\n", "frameNcDN->GetXaxis()->SetLabelOffset(0.005);\n", "frameNcDN->GetXaxis()->SetLabelSize(0.07);\n", "frameNcDN->SetMinimum(Nc_200_Min);\n", "frameNcDN->SetMaximum(Nc_200_Max);\n", "frameNcDN->SetNdivisions(505, \"Y\");\n", "frameNcDN->SetNdivisions(505, \"X\");\n", "frameNcDN->Draw();\n", "\n", "brDN->SetMarkerStyle(23);\n", "brDN->SetMarkerSize(2.0);\n", "brDN->Draw(\"P\");\n", "\n", "phUP->SetMarkerStyle(22);\n", "phUP->SetMarkerSize(2);\n", "phUP->Draw(\"P\");\n", "\n", "TLatex t1;\n", "t1.SetTextFont(12);\n", "t1.SetTextSize(0.0525);\n", "t1.DrawLatex(-5, 0.6,\n", " \"Non-symmetric symbols should be used carefully in plotting.\"\n", " \"These two graphs show how misleading\");\n", "t1.DrawLatex(-5, 0.4,\n", " \"a careless use of symbols can be. The two plots represent \"\n", " \"the same data sets but because of a bad\");\n", "t1.DrawLatex(-5, 0.2,\n", " \"symbol choice, the two plots on the top appear further apart \"\n", " \"than for the bottom example.\");\n", "\n", "canvasNc->cd();" ] }, { "cell_type": "markdown", "id": "1610fe48", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 4, "id": "23602de5", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:19.316248Z", "iopub.status.busy": "2026-05-19T20:37:19.316115Z", "iopub.status.idle": "2026-05-19T20:37:19.532222Z", "shell.execute_reply": "2026-05-19T20:37:19.531812Z" } }, "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 }