Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{pgfplots}
- usepackage{tikz-3dplot}
- pgfplotsset{compat=1.3}
- begin{document}
- tdplotsetmaincoords{60}{120}
- begin{figure}
- centering
- begin{tikzpicture}[scale=1.5, tdplot_main_coords, axis/.style={->,blue,thick},
- vector/.style={-stealth,red,very thick},
- vector guide/.style={dashed,red,thick}]
- begin{axis}[
- axis lines=center,
- axis on top,
- xlabel={$x$}, ylabel={$y$}, zlabel={$t$},
- domain=0:1,
- y domain=0:2*pi,
- xmin=-1.5, xmax=1.5,
- ymin=-1.5, ymax=1.5, zmin=0.0,
- every axis x label/.style={at={(rel axis cs:0,0.5,0)},anchor=south},
- every axis y label/.style={at={(rel axis cs:0.5,0,0)},anchor=north},
- every axis z label/.style={at={(rel axis cs:0.5,0.5,0.9)},anchor=west},
- samples=30]
- addplot3 [surf, colormap/blackwhite, shader=flat] ({x*cos(deg(y))},{x*sin(deg(y))},{x});
- %standard tikz coordinate definition using x, y, z coords
- coordinate (O) at (0,0,0);
- %tikz-3dplot coordinate definition using x, y, z coords
- pgfmathsetmacro{axone}{5}
- pgfmathsetmacro{ayone}{3}
- pgfmathsetmacro{azone}{4}
- pgfmathsetmacro{axtwo}{3}
- pgfmathsetmacro{aytwo}{5}
- pgfmathsetmacro{aztwo}{0}
- coordinate (P1) at (axone,ayone,azone);
- coordinate (P2) at (axtwo,aytwo,aztwo);
- draw[vector] (O) -- (P1);
- draw[vector] (O) -- (P2);
- end{axis}
- end{tikzpicture}
- end{figure}
- end{document}
- documentclass[tikz,border=3.14mm]{standalone}
- usepackage{pgfplots}
- pgfplotsset{compat=1.16}
- begin{document}
- begin{tikzpicture}[scale=1.5,axis/.style={->,blue,thick},
- vector/.style={-stealth,red,very thick},
- vector guide/.style={dashed,red,thick}]
- begin{axis}[
- axis lines=center,
- axis on top,
- xlabel={$x$}, ylabel={$y$}, zlabel={$t$},
- domain=0:1,
- y domain=0:2*pi,
- xmin=-1.5, xmax=1.5,
- ymin=-1.5, ymax=1.5, zmin=0.0,
- every axis x label/.style={at={(rel axis cs:0,0.5,0)},anchor=south},
- every axis y label/.style={at={(rel axis cs:0.5,0,0)},anchor=north},
- every axis z label/.style={at={(rel axis cs:0.5,0.5,0.9)},anchor=west},
- samples=30]
- addplot3 [surf, colormap/blackwhite, shader=flat] ({x*cos(deg(y))},{x*sin(deg(y))},{x});
- %standard tikz coordinate definition using x, y, z coords
- coordinate (O) at (0,0,0);
- %tikz-3dplot coordinate definition using x, y, z coords
- pgfmathsetmacro{axone}{0.5}
- pgfmathsetmacro{ayone}{0.3}
- pgfmathsetmacro{azone}{0.4}
- pgfmathsetmacro{axtwo}{0.3}
- pgfmathsetmacro{aytwo}{0.5}
- pgfmathsetmacro{aztwo}{0}
- coordinate (P1) at (axone,ayone,azone);
- coordinate (P2) at (axtwo,aytwo,aztwo);
- draw[vector] (O) -- (P1);
- draw[vector] (O) -- (P2);
- end{axis}
- end{tikzpicture}
- end{document}
Add Comment
Please, Sign In to add comment