texmf-dist/doc/plain/pgfplots/pgfplotsexample-plain.tex
raw| 1 | %% plain tex file |
| 2 | |
| 3 | \def\pgfsysdriver{pgfsys-pdftex.def} |
| 4 | \input pgfplots.tex |
| 5 | \pgfplotsset{compat=1.12}% <-- moves axis labels near ticklabels (respects tick label widths) |
| 6 | |
| 7 | Using plain-\TeX. |
| 8 | |
| 9 | \tikzpicture |
| 10 | \loglogaxis |
| 11 | \addplot coordinates { |
| 12 | (1,1) |
| 13 | (16,16) |
| 14 | (32,64) |
| 15 | }; |
| 16 | \endloglogaxis |
| 17 | \endtikzpicture |
| 18 | |
| 19 | \tikzpicture |
| 20 | \loglogaxis[ |
| 21 | xlabel=Cost, |
| 22 | ylabel=Error] |
| 23 | \addplot coordinates { |
| 24 | (5, 8.31160034e-02) |
| 25 | (17, 2.54685628e-02) |
| 26 | (49, 7.40715288e-03) |
| 27 | (129, 2.10192154e-03) |
| 28 | (321, 5.87352989e-04) |
| 29 | (769, 1.62269942e-04) |
| 30 | (1793, 4.44248889e-05) |
| 31 | (4097, 1.20714122e-05) |
| 32 | (9217, 3.26101452e-06) |
| 33 | }; |
| 34 | \addplot coordinates { |
| 35 | (7, 8.47178381e-02) |
| 36 | (31, 3.04409349e-02) |
| 37 | (111, 1.02214539e-02) |
| 38 | (351, 3.30346265e-03) |
| 39 | (1023, 1.03886535e-03) |
| 40 | (2815, 3.19646457e-04) |
| 41 | (7423, 9.65789766e-05) |
| 42 | (18943, 2.87339125e-05) |
| 43 | (47103, 8.43749881e-06) |
| 44 | }; |
| 45 | \legend{Case 1,Case 2} |
| 46 | \endloglogaxis |
| 47 | \endtikzpicture |
| 48 | |
| 49 | \bye |