2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-24 05:48:05 +02:00
LaTeX-examples/tikz/ellipsoid/ellipsoid.tex

46 lines
1.3 KiB
TeX
Raw Permalink Normal View History

2012-08-30 14:56:42 +02:00
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{pgfplots}
\usepackage{units}
\pgfplotsset{compat=1.3}% <-- moves axis labels near ticklabels
% (respects tick label widths)
\usepackage{tikz}
\usetikzlibrary{arrows, positioning, calc, intersections, decorations.markings}
\usepackage{xcolor}
\definecolor{horizontalLineColor}{HTML}{008000}
\definecolor{verticalLineColor}{HTML}{FF0000}
2012-08-30 14:56:42 +02:00
\begin{document}
% Define this as a command to ensure that it is same in both cases
\newcommand*{\ShowIntersection}[2]{
\fill
[name intersections={of=#1 and #2, name=i, total=\t}]
[red, opacity=1, every node/.style={above left, black, opacity=1}]
2012-08-30 14:56:42 +02:00
\foreach \s in {1,...,\t}{(i-\s) circle (2pt)
node [above left] {\s}};
}
\begin{preview}
\begin{tikzpicture}
\begin{axis}[
grid=both,
minor tick num=1,
xlabel=$x$,
ylabel=$y$,
zlabel=$z$,
%label distance=0mm,
%width=8cm, height=7cm, % size of the image
axis lines=left,
%tick style={draw=none},
%xticklabels={,,},
%yticklabels={,,}
]
\addplot3[surf, colormap name=viridis] {-(x*x/16+y*y/4-1)};
\end{axis}
2012-08-30 14:56:42 +02:00
\end{tikzpicture}
\end{preview}
\end{document}