Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{tikz,pgfplots}
- usepgfplotslibrary{fillbetween}
- pagestyle{empty}
- begin{document}
- begin{tikzpicture}
- % Eixos
- begin{axis}[
- grid,
- axis x line=center,
- axis y line=center,
- xtick={-1,0,1},
- ytick={-1,0,1},
- xlabel={$x$},
- ylabel={$y$},
- xlabel style={below right},
- ylabel style={above left},
- xmin=-0.5,
- xmax=1.1,
- ymin=-0.5,
- ymax=1.1]
- % Função de cima contínua
- addplot[name path=f,domain=0:1,CCazul] {x};
- % Função de baixo cintínua
- addplot[name path=g,domain=0:1,CCvermelho] {x^2};
- % Função de cima pontilhada
- addplot[dashed, name path=fpont1,domain=-.5:0,CCazul] {x};
- addplot[dashed, name path=fpont2,domain=1:1.1,CCazul] {x};
- % Função de baixo pontilhada
- addplot[dashed, name path=gpont1,domain=-.5:0,CCvermelho] {x^2};
- addplot[dashed, name path=gpont2,domain=1:1.1,CCvermelho] {x^2};
- % Path
- path[name path=axis] (axis cs:0,0) -- (axis cs:1,0);
- %Fill between
- addplot [
- thick,
- color=black,
- fill=black,
- fill opacity=0.05
- ]
- fill between[
- of=f and g,
- soft clip={domain=0:1},
- ];
- % Labels dos nós
- node [color=CCazul] at (axis cs: .55, .8) {$f(x) = x$};
- node [color=CCvermelho] at (axis cs: 0.9, .4) {$g(x) = x^2$};
- end{axis}
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement