mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
2d-chi-squared-cdf: Added
This commit is contained in:
parent
507eed0f98
commit
72f86cf009
4 changed files with 191 additions and 0 deletions
105
tikz/2d-chi-squared-cdf/2d-chi-squared-cdf.pgf-plot.table
Normal file
105
tikz/2d-chi-squared-cdf/2d-chi-squared-cdf.pgf-plot.table
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
|
||||||
|
# Curve 0 of 1, 100 points
|
||||||
|
# Curve title: "chisq(x,9)"
|
||||||
|
# x y type
|
||||||
|
1.0000000e-05 2.6699706e-26 i
|
||||||
|
8.0817980e-02 9.9070360e-09 i
|
||||||
|
1.6162596e-01 2.1683304e-07 i
|
||||||
|
2.4243394e-01 1.3007083e-06 i
|
||||||
|
3.2324192e-01 4.5928761e-06 i
|
||||||
|
4.0404990e-01 1.2130677e-05 i
|
||||||
|
4.8485788e-01 2.6664086e-05 i
|
||||||
|
5.6566586e-01 5.1633614e-05 i
|
||||||
|
6.4647384e-01 9.1129715e-05 i
|
||||||
|
7.2728182e-01 1.4984014e-04 i
|
||||||
|
8.0808980e-01 2.3298965e-04 i
|
||||||
|
8.8889778e-01 3.4627514e-04 i
|
||||||
|
9.6970576e-01 4.9579859e-04 i
|
||||||
|
1.0505137e+00 6.8799945e-04 i
|
||||||
|
1.1313217e+00 9.2958785e-04 i
|
||||||
|
1.2121297e+00 1.2274795e-03 i
|
||||||
|
1.2929377e+00 1.5887329e-03 i
|
||||||
|
1.3737457e+00 2.0204899e-03 i
|
||||||
|
1.4545536e+00 2.5299194e-03 i
|
||||||
|
1.5353616e+00 3.1241646e-03 i
|
||||||
|
1.6161696e+00 3.8102938e-03 i
|
||||||
|
1.6969776e+00 4.5952561e-03 i
|
||||||
|
1.7777856e+00 5.4858396e-03 i
|
||||||
|
1.8585935e+00 6.4886344e-03 i
|
||||||
|
1.9394015e+00 7.6099988e-03 i
|
||||||
|
2.0202095e+00 8.8560302e-03 i
|
||||||
|
2.1010175e+00 1.0232538e-02 i
|
||||||
|
2.1818255e+00 1.1745022e-02 i
|
||||||
|
2.2626334e+00 1.3398650e-02 i
|
||||||
|
2.3434414e+00 1.5198247e-02 i
|
||||||
|
2.4242494e+00 1.7148275e-02 i
|
||||||
|
2.5050574e+00 1.9252827e-02 i
|
||||||
|
2.5858654e+00 2.1515619e-02 i
|
||||||
|
2.6666733e+00 2.3939980e-02 i
|
||||||
|
2.7474813e+00 2.6528853e-02 i
|
||||||
|
2.8282893e+00 2.9284793e-02 i
|
||||||
|
2.9090973e+00 3.2209966e-02 i
|
||||||
|
2.9899053e+00 3.5306153e-02 i
|
||||||
|
3.0707132e+00 3.8574753e-02 i
|
||||||
|
3.1515212e+00 4.2016787e-02 i
|
||||||
|
3.2323292e+00 4.5632911e-02 i
|
||||||
|
3.3131372e+00 4.9423413e-02 i
|
||||||
|
3.3939452e+00 5.3388236e-02 i
|
||||||
|
3.4747531e+00 5.7526973e-02 i
|
||||||
|
3.5555611e+00 6.1838891e-02 i
|
||||||
|
3.6363691e+00 6.6322934e-02 i
|
||||||
|
3.7171771e+00 7.0977737e-02 i
|
||||||
|
3.7979851e+00 7.5801640e-02 i
|
||||||
|
3.8787930e+00 8.0792701e-02 i
|
||||||
|
3.9596010e+00 8.5948706e-02 i
|
||||||
|
4.0404090e+00 9.1267187e-02 i
|
||||||
|
4.1212170e+00 9.6745433e-02 i
|
||||||
|
4.2020249e+00 1.0238050e-01 i
|
||||||
|
4.2828329e+00 1.0816924e-01 i
|
||||||
|
4.3636409e+00 1.1410829e-01 i
|
||||||
|
4.4444489e+00 1.2019410e-01 i
|
||||||
|
4.5252569e+00 1.2642297e-01 i
|
||||||
|
4.6060648e+00 1.3279101e-01 i
|
||||||
|
4.6868728e+00 1.3929419e-01 i
|
||||||
|
4.7676808e+00 1.4592837e-01 i
|
||||||
|
4.8484888e+00 1.5268925e-01 i
|
||||||
|
4.9292968e+00 1.5957245e-01 i
|
||||||
|
5.0101047e+00 1.6657348e-01 i
|
||||||
|
5.0909127e+00 1.7368778e-01 i
|
||||||
|
5.1717207e+00 1.8091070e-01 i
|
||||||
|
5.2525287e+00 1.8823754e-01 i
|
||||||
|
5.3333367e+00 1.9566354e-01 i
|
||||||
|
5.4141446e+00 2.0318390e-01 i
|
||||||
|
5.4949526e+00 2.1079381e-01 i
|
||||||
|
5.5757606e+00 2.1848840e-01 i
|
||||||
|
5.6565686e+00 2.2626283e-01 i
|
||||||
|
5.7373766e+00 2.3411223e-01 i
|
||||||
|
5.8181845e+00 2.4203174e-01 i
|
||||||
|
5.8989925e+00 2.5001653e-01 i
|
||||||
|
5.9798005e+00 2.5806176e-01 i
|
||||||
|
6.0606085e+00 2.6616266e-01 i
|
||||||
|
6.1414165e+00 2.7431445e-01 i
|
||||||
|
6.2222244e+00 2.8251243e-01 i
|
||||||
|
6.3030324e+00 2.9075193e-01 i
|
||||||
|
6.3838404e+00 2.9902832e-01 i
|
||||||
|
6.4646484e+00 3.0733707e-01 i
|
||||||
|
6.5454564e+00 3.1567367e-01 i
|
||||||
|
6.6262643e+00 3.2403370e-01 i
|
||||||
|
6.7070723e+00 3.3241282e-01 i
|
||||||
|
6.7878803e+00 3.4080674e-01 i
|
||||||
|
6.8686883e+00 3.4921128e-01 i
|
||||||
|
6.9494963e+00 3.5762231e-01 i
|
||||||
|
7.0303042e+00 3.6603583e-01 i
|
||||||
|
7.1111122e+00 3.7444788e-01 i
|
||||||
|
7.1919202e+00 3.8285464e-01 i
|
||||||
|
7.2727282e+00 3.9125234e-01 i
|
||||||
|
7.3535362e+00 3.9963733e-01 i
|
||||||
|
7.4343441e+00 4.0800606e-01 i
|
||||||
|
7.5151521e+00 4.1635507e-01 i
|
||||||
|
7.5959601e+00 4.2468099e-01 i
|
||||||
|
7.6767681e+00 4.3298056e-01 i
|
||||||
|
7.7575761e+00 4.4125064e-01 i
|
||||||
|
7.8383840e+00 4.4948816e-01 i
|
||||||
|
7.9191920e+00 4.5769015e-01 i
|
||||||
|
8.0000000e+00 4.6585378e-01 i
|
||||||
|
|
52
tikz/2d-chi-squared-cdf/2d-chi-squared-cdf.tex
Normal file
52
tikz/2d-chi-squared-cdf/2d-chi-squared-cdf.tex
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
\documentclass[border=2pt]{standalone}
|
||||||
|
|
||||||
|
\usepackage{pgfplots}
|
||||||
|
\pgfplotsset{compat=1.16}
|
||||||
|
\usepackage{tikz}
|
||||||
|
\usepackage{xcolor}
|
||||||
|
\definecolor{yellow}{HTML}{cccc00}
|
||||||
|
\definecolor{neongreen}{HTML}{00dd00}
|
||||||
|
\definecolor{turquoise}{HTML}{00cccc}
|
||||||
|
\definecolor{lila}{HTML}{aa00aa}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\pgfplotscreateplotcyclelist{mylist}{%
|
||||||
|
{yellow},
|
||||||
|
{neongreen, densely dashed},
|
||||||
|
{turquoise, dashed},
|
||||||
|
{blue,densely dotted},
|
||||||
|
{lila,dotted},
|
||||||
|
{red,loosely dotted},
|
||||||
|
{black}}
|
||||||
|
\begin{tikzpicture}
|
||||||
|
\begin{axis}[
|
||||||
|
title=$\chi^2_k$,
|
||||||
|
legend style={at={(0.95, 0.95), anchor=north west}},
|
||||||
|
axis x line=middle,
|
||||||
|
axis y line=middle,
|
||||||
|
grid = major,
|
||||||
|
width = 16cm,
|
||||||
|
height= 9cm,
|
||||||
|
grid style={dashed, gray!30},
|
||||||
|
domain = 0.01:8,
|
||||||
|
restrict y to domain = 0:1,
|
||||||
|
axis background/.style={fill=white},
|
||||||
|
xlabel=$x$,
|
||||||
|
ylabel=$F_k(x)$,
|
||||||
|
tick align=outside,
|
||||||
|
enlargelimits=true,
|
||||||
|
every axis plot/.append style={very thick},
|
||||||
|
cycle list name=mylist
|
||||||
|
]
|
||||||
|
\foreach \k in {1, 2, 3, 4, 6, 9} {%
|
||||||
|
\addplot+[mark={}] gnuplot[raw gnuplot] {%
|
||||||
|
igamma2(a,x) = igamma(a,x)*gamma(a);
|
||||||
|
chisq(x,k)=igamma2(k/2.0, x/2.0) / gamma(k/2.0);
|
||||||
|
set xrange [1.00000e-5:8];
|
||||||
|
set yrange [0.00000:1.0];
|
||||||
|
samples=800;
|
||||||
|
plot chisq(x,\k)};
|
||||||
|
\addlegendentryexpanded{$k = \k$}}
|
||||||
|
\end{axis}
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{document}
|
31
tikz/2d-chi-squared-cdf/Makefile
Normal file
31
tikz/2d-chi-squared-cdf/Makefile
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
SOURCE = 2d-chi-squared-cdf
|
||||||
|
DELAY = 80
|
||||||
|
DENSITY = 300
|
||||||
|
WIDTH = 512
|
||||||
|
|
||||||
|
make:
|
||||||
|
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
|
||||||
|
make clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
|
||||||
|
|
||||||
|
gif:
|
||||||
|
pdfcrop $(SOURCE).pdf
|
||||||
|
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
|
||||||
|
make clean
|
||||||
|
|
||||||
|
png:
|
||||||
|
make
|
||||||
|
make svg
|
||||||
|
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
|
||||||
|
|
||||||
|
transparentGif:
|
||||||
|
convert $(SOURCE).pdf -transparent white result.gif
|
||||||
|
make clean
|
||||||
|
|
||||||
|
svg:
|
||||||
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
|
# Necessary, as pdf2svg does not always create valid svgs:
|
||||||
|
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
|
3
tikz/2d-chi-squared-cdf/README.md
Normal file
3
tikz/2d-chi-squared-cdf/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
Loading…
Add table
Add a link
Reference in a new issue