Advertisement
Guest User

Untitled

a guest
May 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.31 KB | None | 0 0
  1. \documentclass{standalone}
  2.  
  3. \usepackage {tikz}
  4. \usepackage{pgfplots}
  5. \usetikzlibrary{pgfplots.groupplots}
  6.  
  7. \pgfmathdeclarefunction{gauss}{2}{%
  8.   \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
  9. }
  10.  
  11. \begin{document}
  12. \begin{tikzpicture}
  13.    \begin{groupplot}[
  14.         group style={group name=gaussians, group size=1 by 3, %quantas linhas?
  15.             xlabels at=edge bottom, xticklabels at=edge bottom, % coloca x axis so embaixo
  16.             vertical sep=0pt}, %fica juntinho
  17.         every axis plot post/.append style={mark=none,domain=-3:3,samples=50,smooth}, % como popular as curvas
  18.         footnotesize, xlabel=Nome do eixo?, % tamanho fonte e nome eixo
  19.         width=8cm, height=3cm, xmin=-3, xmax=3, ymin=0, ymax=1, % medidas do grafico
  20.         xtick={-3, -2, ..., 3}, ytick={0}, % ticks
  21.         tickpos=left, ytick align=outside,xtick align=outside] % configuracao das marquinha
  22. \nextgroupplot[y coord inv trafo/.code={\pgfmathparse{\pgfmathresult + 0}}] % hack pra mudar yticks
  23. \addplot[draw=blue] {gauss(0,0.5)};
  24. \nextgroupplot[y coord inv trafo/.code={\pgfmathparse{\pgfmathresult + 1}}]
  25. \addplot[draw=red] {gauss(1,0.75)};
  26. \nextgroupplot[y coord inv trafo/.code={\pgfmathparse{\pgfmathresult + 2}}]
  27. \addplot[draw=green] {gauss(-1, 0.4)};
  28. \end{groupplot}
  29. \end{tikzpicture}
  30.  
  31. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement