diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-08 23:14:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-08 23:14:22 +0000 |
commit | dec0beb77f2062b8eaadbdd146471de0c03a5d09 (patch) | |
tree | 1ab4fe6c0b9c4b6f9a72c902e9a8bce3b69cc30d /Master/texmf-dist/doc/latex/svg/root.C | |
parent | 5eb4f4738d8f87b2486d3a93ff07a6744f16a5df (diff) |
new latex package svg (8sep12)
git-svn-id: svn://tug.org/texlive/trunk@27618 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/svg/root.C')
-rw-r--r-- | Master/texmf-dist/doc/latex/svg/root.C | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/svg/root.C b/Master/texmf-dist/doc/latex/svg/root.C new file mode 100644 index 00000000000..3575ff754ec --- /dev/null +++ b/Master/texmf-dist/doc/latex/svg/root.C @@ -0,0 +1,26 @@ +void root() { + + // Set the style. + gStyle->SetTextFont(80); gStyle->SetLabelFont(80,"XYZ"); + gStyle->SetTitleFont(80,""); gStyle->SetTitleFont(80,"XYZ"); + gStyle->SetPalette(1); gStyle->SetOptStat(0); + + // Draw the plot. + TH2D *h = new TH2D("", "", 25, 0, 3.9, 25, 0, 3.9); TRandom r; + for (int i = 0; i < 30000; i++) h->Fill(r.Gaus(2.,1), r.Gaus(2.,1)); + h->GetXaxis()->CenterTitle(); h->GetXaxis()->SetTitleOffset(2.5); + h->GetYaxis()->CenterTitle(); h->GetYaxis()->SetTitleOffset(2.5); + h->GetXaxis()->SetTitle("\\larger[2]$x$"); + h->GetYaxis()->SetTitle("\\larger[2]$y$"); + h->Draw("LEGO2"); + + // Draw additional text. + TText *t = new TText(); t->SetTextAlign(31); + t->DrawText(0.7, 0.9, "\\larger[2]$z(x,y) = \\frac{1}{\\sigma_x\\sigma_y" + "\\sqrt{4\\pi^2}}\\exp\\left(- \\left(\\frac{(x-\\mu_x)^2}" + "{2\\sigma_x^2} + \\frac{(y-\\mu_y)^2}{2\\sigma_y^2} \\right)" + "\\right)$"); + + // Print the plot. + gPad->Print("root.svg"); +} |