Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage[english,russian]{babel}
- \usepackage{tikz}
- \usepackage{pgfplots}
- \pgfplotsset{width = 15 cm, compat = 1.3}
- \begin{document}
- \begin{tikzpicture}
- \begin{axis}[
- title = Домашнее задание 1,
- xmin = -5,
- xmax = 5,
- ymin = 0,
- ymax = 25,
- axis lines = middle,
- samples=40,
- xlabel = Ox,
- ylabel = Oy,
- minor tick num = 5,
- grid = both,
- legend style = {at = {(0.2, 0.05)},anchor = south east,
- legend columns = 1;}
- ]
- \addplot+[domain=-5:5, green, mark = square, mark size = 3, line width = 1pt]{e^x};
- \addplot+[domain=-5:5, orange, mark = triangle, mark size = 5, line width = 1pt]{e^(-x)};
- \addplot[domain=-5:5, red, dashed, line width = 2pt]{12};
- %solid - сплошная, dotted - в виде точек
- \legend{$e^x$, $e^{-x}$, $y = 12$};
- \end{axis}
- \end{tikzpicture}
- \begin{tikzpicture}
- \begin{axis}[
- title = Домашнее задание 2,
- ybar,
- bar width = 10 pt,
- xlabel = Year,
- ylabel = Temperature,
- ymin = 10,
- ymax = 55,
- xtick = {2013, 2014, 2015},
- ytick = {10, 20, 30, 35, 40, 45, 50},
- minor tick num = 5,
- grid = both,
- grid style = dashed,
- legend style={at={(0.5, -0.3)},anchor = south, legend columns = 1},
- ]
- \addplot [red, fill] coordinates {(2013, 35) (2014, 33) (2015, 25)};
- \addplot [yellow, fill] coordinates {(2013, 33) (2014, 29) (2015, 30)};
- \addplot [green, fill] coordinates {(2013, 40) (2014, 38) (2015, 41)};
- \addplot [blue, fill] coordinates {(2013, 24) (2014, 28) (2015, 25)};
- \legend{Саратов, Москва, Пермь, Омск};
- \end{axis}
- \end{tikzpicture}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement