2D Graphics Libraries

TASImage

TPDF and TPostScript

TSVG

TImageDump

TMathText

    {
    {
       TMathText l;
       l.SetTextAlign(23);
       l.SetTextSize(0.06);
       l.DrawMathText(0.50, 1.000, "\\prod_{j\\ge0} \\left(\\sum_{k\\ge0} a_{jk}z^k\\right) = \\sum_{n\\ge0} z^n \\left(\\sum_{k_0,k_1,\\ldots\\ge0\\atop k_0+k_1+\\cdots=n} a_{0k_0}a_{1k_1} \\cdots \\right)");
       l.DrawMathText(0.50, 0.800, "W_{\\delta_1\\rho_1\\sigma_2}^{3\\beta} = U_{\\delta_1\\rho_1\\sigma_2}^{3\\beta} + {1\\over 8\\pi^2} \\int_{\\alpha_1}^{\\alpha_2} d\\alpha_2^\\prime \\left[ {U_{\\delta_1\\rho_1}^{2\\beta} - \\alpha_2^\\prime U_{\\rho_1\\sigma_2}^{1\\beta} \\over U_{\\rho_1\\sigma_2}^{0\\beta}} \\right]");
       l.DrawMathText(0.50, 0.600, "d\\Gamma = {1\\over 2m_A} \\left( \\prod_f {d^3p_f\\over (2\\pi)^3} {1\\over 2E_f} \\right) \\left| \\mathscr{M} \\left(m_A - \\left\\{p_f\\right\\} \\right) \\right|^2 (2\\pi)^4 \\delta^{(4)} \\left(p_A - \\sum p_f \\right)");
       l.DrawMathText(0.50, 0.425, "4\\mathrm{Re}\\left\\{{2\\over 1-\\Delta\\alpha} \\chi(s) \\left[ \\^{g}_\\nu^e \\^{g}_\\nu^f (1 + \\cos^2\\theta) + \\^{g}_a^e \\^{g}_a^f \\cos\\theta \\right] \\right\\}");
       l.DrawMathText(0.50, 0.330, "p(n) = {1\\over\\pi\\sqrt{2}} \\sum_{k = 1}^\\infty \\sqrt{k} A_k(n) {d\\over dn} {\\sinh \\left\\{ {\\pi\\over k} \\sqrt{2\\over 3} \\sqrt{n - {1\\over 24}} \\right\\} \\over \\sqrt{n - {1\\over 24}}}");
       l.DrawMathText(0.13, 0.150, "{(\\ell+1)C_{\\ell}^{TE} \\over 2\\pi}");
       l.DrawMathText(0.27, 0.110, "\\mathbb{N} \\subset \\mathbb{R}");
       l.DrawMathText(0.63, 0.100, "\\hbox{RHIC スピン物理 Нью-Йорк}");
    }
TMathText example

TMathText example

TLegend

TPie

TLine

TPave

TLatex

       TLatex t; t.DrawLatex( 0.1,0.1,"text   #Lambda" )

TCanvas and TPad

TGaxis and TAxis

New class TTeXDump: Graphics interface to TeX

This class allow to generate PGF/TikZ vector graphics output which can be included in TeX and LaTeX documents.

PGF is a TeX macro package for generating graphics. It is platform and format-independent and works together with the most important TeX backend drivers, including pdftex and dvips. It comes with a user-friedly syntax layer called TikZ.

To generate a such file it is enough to do:

   gStyle->SetPaperSize(10.,10.);
   hpx->Draw();
   gPad->Print("hpx.tex");

Then, the generated file (hpx.tex) can be included in a LaTeX document (simple.tex) in the following way:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\title{A simple LaTeX example}
\date{July 2013}
\begin{document}
\maketitle
The following image as been generated using the TTeXDump class:
\par
\input{hpx.tex}
\end{document}

Note the two directive needed at the top of the LaTeX file:

\usepackage{tikz}
\usetikzlibrary{patterns}

Then including the picture in the document is done with the \input directive.

The command pdflatex simple.tex will generate the corresponding pdf file simple.pdf.

X11 fonts

New graphical back-end for MacOSX

TGCocoa/TGQuartz classes are the implementation of TVirtualX based on Cocoa and Quartz 2D. They let to use ROOT's GUI and graphics on MacOS X without installing X11.app and also give an access to Apple's native graphics and GUI frameworks. Window management, event loop, event dispatching, etc. are implemented on top of Cocoa. Graphics (GUI rendering and non-GUI) is done by Quartz 2D (Core Grapchis). An example of a TCanvas with a THStack object, transparency, anti-aliasing, gradient fill, shadows:

Transparency and gradients
ROOT must be configured with --enable-cocoa parameter to use Cocoa back-end instead of X11 version. Please note, this is still a work in progress.