Latex course for IAS IEEE branch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
820 B

  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \usepackage{pgfplots}
  4. \pgfplotsset{compat=1.5.1}
  5. \begin{document}
  6. %1: latex as calculator
  7. \begin{tikzpicture}
  8. \begin{axis}
  9. [xlabel=$x$,
  10. ylabel=$f(x)$]
  11. \addplot{x^2+4};
  12. \end{axis}
  13. \end{tikzpicture}
  14. %2: coordinates
  15. \begin{tikzpicture}
  16. \begin{axis}
  17. [xlabel=$x$,
  18. ylabel=$f(x)$]
  19. \addplot [color=black, mark=o, mark size=12pt]coordinates{
  20. (0,0)
  21. (1,2)};
  22. \addlegendentry{Data}
  23. \end{axis}
  24. \end{tikzpicture}
  25. %3: csv
  26. \begin{tikzpicture}
  27. \begin{axis}[
  28. %legend style={draw =none},
  29. legend pos = north west, % south west, south east, outer
  30. legend columns = 2
  31. ]
  32. \addplot table[x=time, y=voltaje, col sep=comma]{data.csv};
  33. \addlegendentry{voltaje}
  34. \addplot table[x=time, y=corriente, col sep=comma]{data.csv};
  35. \addlegendentry{Corriente}
  36. \end{axis}
  37. \end{tikzpicture}
  38. \end{document}