summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/svg/root.C
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-09-08 23:14:22 +0000
committerKarl Berry <karl@freefriends.org>2012-09-08 23:14:22 +0000
commitdec0beb77f2062b8eaadbdd146471de0c03a5d09 (patch)
tree1ab4fe6c0b9c4b6f9a72c902e9a8bce3b69cc30d /Master/texmf-dist/doc/latex/svg/root.C
parent5eb4f4738d8f87b2486d3a93ff07a6744f16a5df (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.C26
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");
+}