Advertisement
kokokozhina

diagrams

Apr 20th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 2.28 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 = Simple function 1,
  12. xmin = -30,
  13. xmax = 30,
  14. ymin = -30,
  15. ymax = 30,
  16. grid = major,
  17. legend style = {at ={ (0.5, -0.1)}, anchor = north,
  18. legend columns = -1;}
  19. ]
  20. \addplot[domain=-10:10, red, line width = 2pt]{x^2};
  21. \addplot+[domain=-10:10, blue, line width = 2pt]{-x^2};
  22. \addplot[domain=-10:10, magenta, line width = 1pt]{x^3};
  23. \addplot[domain=-10:10, orange, line width = 1pt]{-x^3};
  24. \addplot[domain=-30:30, dashed]{x}; %solid - сплошная, dotted - в виде точек
  25. \addplot[domain=-30:30, dotted]{-x};
  26. \legend{$x^2$, $-x^2$, $x^3$, $-x^3$, $x$, $-x$};
  27. \end{axis}
  28. \end{tikzpicture}
  29.  
  30. \begin{tikzpicture}
  31. \begin{axis}[
  32. title = simple function 2,
  33. axis lines = middle,
  34. samples=500,
  35. xlabel = Ox,
  36. ylabel = Oy,
  37. xmin = -10,
  38. xmax = 10,
  39. ymin = -10,
  40. ymax = 10,
  41. minor tick num = 1,
  42. grid = major,
  43. grid style = dotted,
  44. restrict y to domain=-10:10
  45. ]
  46. \addplot[domain = -10:10, blue] {1/x};
  47. \addplot[domain = -10:10, red, line width = 2 pt] {-1/x};
  48. \end{axis}
  49. \end{tikzpicture}
  50.  
  51. \begin{tikzpicture}
  52. \begin{axis}[
  53. title = Temperature dependance of Time,
  54. xlabel = {Temperature, C},
  55. ylabel = {Time, sec},
  56. xmin = 0, xmax =  100, ymin = 0, ymax = 60,
  57. xtick = {0, 20, 40, 60, 80, 100}, %(0, 20, ..., 100)
  58. ytick = {0, 20, 40, 60},
  59. minor tick num = 2,
  60. grid = both, %minor, none
  61. grid style = dashed,
  62. legend pos =north west
  63. ]
  64. \addplot[const plot, blue, mark = square, mark size = 3 pt] %smooth
  65. coordinates
  66.  {(0.0) (10, 8.7) (9, 7) (1.2, 2.3) (4, 5) (100, 55) (90, 2) (15, 45)};
  67. \legend{water}
  68. \end{axis}
  69. \end{tikzpicture}
  70.  
  71. \begin{tikzpicture}
  72. \begin{axis}[
  73. title = Средний балл ЕГЭ,
  74. ybar,
  75. bar width = 23 pt,
  76. xlabel = years,
  77. ylabel = points,
  78. ymin = 0,
  79. ymax = 100,
  80. xtick = {2013, 2014, 2015},
  81. ytick = {0, 20, ..., 100},
  82. minor tick num = 1,
  83. grid = major,
  84. grid style = dashed,
  85. legend style={at={(0.5, -0.18)},anchor = south, legend columns = -1},
  86. ]
  87. \addplot coordinates {(2013, 37.5) (2014, 60) (2015, 78)};
  88. \addplot coordinates {(2013, 45) (2014, 50) (2015, 88)};
  89. \legend{Саратов, Москва};
  90. \end{axis}
  91. \end{tikzpicture}
  92.  
  93. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement