Graficas a partir de los datos en LaTeX
Este video esta dedicado a explicar como construir graficas en dos dimensiones a partir de archivos, escribiendo los datos o a partir de una ecuacion, todo esto, en LaTeX.
archivo.tex
\documentclass{article}
\usepackage{tikz,xcolor,pgfplots}
\pgfplotsset{compat=1.5}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$, ylabel=$y$,
xmin=-6,xmax=6,
width=10cm,height=5cm]
\addplot[blue,mark=square*,mark size=0.5pt] plot coordinates {
(-6.00, 0.03)
(-5.50, 0.03)
(-5.00, 0.04)
(-4.50, 0.05)
(-4.00, 0.06)
(-3.50, 0.08)
(-3.00, 0.10)
(-2.50, 0.14)
(-2.00, 0.20)
(-1.50, 0.31)
(-1.00, 0.50)
(-0.50, 0.80)
(0.00, 1.00)
(0.50, 0.80)
(1.00, 0.50)
(1.50, 0.31)
(2.00, 0.20)
(2.50, 0.14)
(3.00, 0.10)
(3.50, 0.08)
(4.00, 0.06)
(4.50, 0.05)
(5.00, 0.04)
(5.50, 0.03)
(6.00, 0.03)
};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$, ylabel=$y$,
xmin=-6,xmax=6,
width=10cm,height=5cm]
\addplot[red,smooth]table {datos0.dat};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$, ylabel=$y$,
xmin=-6,xmax=6,
width=10cm,height=5cm]
\addplot[red!80!white,thick, samples=200,domain=-6:6]{(1+x^4)*exp(-x^2/2)};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$, ylabel=$y$,
xmin=-360,xmax=360,
width=10cm,height=5cm,
trig format=deg]
\addplot[red!80!white,thick, samples=200,domain=-360:360]{cos(x)};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[xlabel=$x$, ylabel=$y$,xmin=0,xmax=3,width=10cm,height=5cm,trig format=rad]
\addplot[red!80!white,thick, samples=200,domain=0.01:3]{exp(-x)*cos(1/x)};
\end{axis}
\end{tikzpicture}
\end{document}
datos0.dat
x y
-6.00 0.03
-5.50 0.03
-5.00 0.04
-4.50 0.05
-4.00 0.06
-3.50 0.08
-3.00 0.10
-2.50 0.14
-2.00 0.20
-1.50 0.31
-1.00 0.50
-0.50 0.80
0.00 1.00
0.50 0.80
1.00 0.50
1.50 0.31
2.00 0.20
2.50 0.14
3.00 0.10
3.50 0.08
4.00 0.06
4.50 0.05
5.00 0.04
5.50 0.03
6.00 0.03