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 = Simple function 1,
- xmin = -30,
- xmax = 30,
- ymin = -30,
- ymax = 30,
- grid = major,
- legend style = {at ={ (0.5, -0.1)}, anchor = north,
- legend columns = -1;}
- ]
- \addplot[domain=-10:10, red, line width = 2pt]{x^2};
- \addplot+[domain=-10:10, blue, line width = 2pt]{-x^2};
- \addplot[domain=-10:10, magenta, line width = 1pt]{x^3};
- \addplot[domain=-10:10, orange, line width = 1pt]{-x^3};
- \addplot[domain=-30:30, dashed]{x}; %solid - сплошная, dotted - в виде точек
- \addplot[domain=-30:30, dotted]{-x};
- \legend{$x^2$, $-x^2$, $x^3$, $-x^3$, $x$, $-x$};
- \end{axis}
- \end{tikzpicture}
- \begin{tikzpicture}
- \begin{axis}[
- title = simple function 2,
- axis lines = middle,
- samples=500,
- xlabel = Ox,
- ylabel = Oy,
- xmin = -10,
- xmax = 10,
- ymin = -10,
- ymax = 10,
- minor tick num = 1,
- grid = major,
- grid style = dotted,
- restrict y to domain=-10:10
- ]
- \addplot[domain = -10:10, blue] {1/x};
- \addplot[domain = -10:10, red, line width = 2 pt] {-1/x};
- \end{axis}
- \end{tikzpicture}
- \begin{tikzpicture}
- \begin{axis}[
- title = Temperature dependance of Time,
- xlabel = {Temperature, C},
- ylabel = {Time, sec},
- xmin = 0, xmax = 100, ymin = 0, ymax = 60,
- xtick = {0, 20, 40, 60, 80, 100}, %(0, 20, ..., 100)
- ytick = {0, 20, 40, 60},
- minor tick num = 2,
- grid = both, %minor, none
- grid style = dashed,
- legend pos =north west
- ]
- \addplot[const plot, blue, mark = square, mark size = 3 pt] %smooth
- coordinates
- {(0.0) (10, 8.7) (9, 7) (1.2, 2.3) (4, 5) (100, 55) (90, 2) (15, 45)};
- \legend{water}
- \end{axis}
- \end{tikzpicture}
- \begin{tikzpicture}
- \begin{axis}[
- title = Средний балл ЕГЭ,
- ybar,
- bar width = 23 pt,
- xlabel = years,
- ylabel = points,
- ymin = 0,
- ymax = 100,
- xtick = {2013, 2014, 2015},
- ytick = {0, 20, ..., 100},
- minor tick num = 1,
- grid = major,
- grid style = dashed,
- legend style={at={(0.5, -0.18)},anchor = south, legend columns = -1},
- ]
- \addplot coordinates {(2013, 37.5) (2014, 60) (2015, 78)};
- \addplot coordinates {(2013, 45) (2014, 50) (2015, 88)};
- \legend{Саратов, Москва};
- \end{axis}
- \end{tikzpicture}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement