Advertisement
kokokozhina

4hw

Apr 26th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.57 KB | None | 0 0
  1. \documentclass{article}
  2. \usepackage[english,russian]{babel}
  3. \usepackage{tikz}
  4. \usepackage{pgfplots}
  5. \pgfplotsset{width = 15 cm, compat = 1.3}
  6.  
  7.  
  8. \begin{document}
  9. \begin{tikzpicture}
  10. \begin{axis}[
  11. title = Домашнее задание 1,
  12. xmin = -5,
  13. xmax = 5,
  14. ymin = 0,
  15. ymax = 25,
  16. axis lines = middle,
  17. samples=40,
  18. xlabel = Ox,
  19. ylabel = Oy,
  20. minor tick num = 5,
  21. grid = both,
  22. legend style = {at = {(0.2, 0.05)},anchor = south east,
  23. legend columns = 1;}
  24. ]
  25. \addplot+[domain=-5:5, green, mark = square, mark size = 3, line width = 1pt]{e^x};
  26. \addplot+[domain=-5:5, orange, mark = triangle,  mark size = 5, line width = 1pt]{e^(-x)};
  27. \addplot[domain=-5:5, red, dashed, line width = 2pt]{12};
  28. %solid - сплошная, dotted - в виде точек
  29. \legend{$e^x$, $e^{-x}$, $y = 12$};
  30. \end{axis}
  31. \end{tikzpicture}
  32.  
  33. \begin{tikzpicture}
  34. \begin{axis}[
  35. title = Домашнее задание 2,
  36. ybar,
  37. bar width = 10 pt,
  38. xlabel = Year,
  39. ylabel = Temperature,
  40. ymin = 10,
  41. ymax = 55,
  42. xtick = {2013, 2014, 2015},
  43. ytick = {10, 20, 30, 35, 40, 45, 50},
  44. minor tick num = 5,
  45. grid = both,
  46. grid style = dashed,
  47. legend style={at={(0.5, -0.3)},anchor = south, legend columns = 1},
  48. ]
  49. \addplot [red, fill] coordinates {(2013, 35) (2014, 33) (2015, 25)};
  50. \addplot  [yellow, fill] coordinates {(2013, 33) (2014, 29) (2015, 30)};
  51. \addplot  [green, fill] coordinates {(2013, 40) (2014, 38) (2015, 41)};
  52. \addplot [blue, fill]  coordinates {(2013, 24) (2014, 28) (2015, 25)};
  53. \legend{Саратов, Москва, Пермь, Омск};
  54. \end{axis}
  55. \end{tikzpicture}
  56.  
  57. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement