pgfplots: Torus, Möbiusband und Klein'sche Flasche plotten
Verfasst: So 4. Dez 2011, 14:06
Hallo,
ich möchte folgendes plotten: Torus, Möbiusband und Klein'sche Flasche.
Ich habe mich dabei an die Funktionsvorschriften von Wikipedia gehalten. Aber irgendwie mag das ganze nicht so funktionieren (siehe Output meines Minimalbeispiels). Wikipedia behauptet zwar, es seien kartesische Koordinaten und keine Polarkoordinaten ... ich bin aber irgendwie verwirrt, denn man gibt ja Winkel an ... aber ich bin gerade eh so durcheinander, dass ich nicht mehr sagen kann, welche Koordinaten es sind
.
Wo liegt mein Fehler denn? Kann mir da vielleicht jemand helfen?
Und: Ich habe Linux, recht aktuell gehalten, und nutze TeXLive. Wenn ich die library "polar" hinzupacke, findet er die Datei nicht:
Hier das Beispiel (der 2. Plot soll nur zeigen, dass generell alles toll funktioniert, wenn man ein Beispiel aus dem Handbuch nimmt
):
Kurze Frage nebenbei, weil ich dafür nicht ein extra Thema aufmachen möchte: Warum genügt
nicht, um auch bei der y-Achse einen (imho schöneren) LaTeX-Pfeil wie bei der x-Achse zu bekommen?
Viele Grüße,
\\ guy.brush
ich möchte folgendes plotten: Torus, Möbiusband und Klein'sche Flasche.
Ich habe mich dabei an die Funktionsvorschriften von Wikipedia gehalten. Aber irgendwie mag das ganze nicht so funktionieren (siehe Output meines Minimalbeispiels). Wikipedia behauptet zwar, es seien kartesische Koordinaten und keine Polarkoordinaten ... ich bin aber irgendwie verwirrt, denn man gibt ja Winkel an ... aber ich bin gerade eh so durcheinander, dass ich nicht mehr sagen kann, welche Koordinaten es sind

Wo liegt mein Fehler denn? Kann mir da vielleicht jemand helfen?
Und: Ich habe Linux, recht aktuell gehalten, und nutze TeXLive. Wenn ich die library "polar" hinzupacke, findet er die Datei nicht:
Ist die etwa nicht in TeXLive enthalten? ["groupplots" kannte er, "patchplots" hingegen wieder nicht ... mehr habe ich aber auch nicht getestet.](/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
plotmarks.code.tex
File: tikzlibraryplotmarks.code.tex 2008/01/09 v2.10 (rcs-revision 1.1)
(/usr/share/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex
File: pgflibraryplotmarks.code.tex 2010/10/15 v2.10 (rcs-revision 1.12)
)))
! I can't find file `pgflibrarypgfplots.polar.code.tex'.
<to be read again>
\relax
l.12 \usepgfplotslibrary{polar}
(Press Enter to retry, or Control-D to exit)
Please type another input file name
! Emergency stop.
<to be read again>
\relax
l.12 \usepgfplotslibrary{polar}
*** (job aborted, file error in nonstop mode)
Hier das Beispiel (der 2. Plot soll nur zeigen, dass generell alles toll funktioniert, wenn man ein Beispiel aus dem Handbuch nimmt

\documentclass[a4paper,% 11pt]{scrartcl} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{matrix,arrows,calc,intersections} \usepackage{pgfplots} % \pgfplotsset{compat=1.3} % \usepgfplotslibrary{polar} \begin{document} \begin{tikzpicture} \centering \begin{axis}[axis x line=left, axis y line=left, axis line style={->}]%, every outer y axis line/.append style={->}] \centering \addplot[smooth] coordinates { (0,0) (1,1) (2,5) (3,1) (4,7) (5,1) }; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[height=10cm, scatter] % \addplot3[surf, faceted color=black, domain=1:100, y domain=1:10] {y}; \addplot3[surf,z buffer=sort,samples=20,domain=-1:0,y domain=0:2*pi] ({sqrt(1-x^2) * cos(deg(y))}, {sqrt( 1-x^2 ) * sin(deg(y))}, x); \end{axis} \end{tikzpicture} \begin{figure} \centering \begin{tikzpicture} \newcommand{\radius}{2} \newcommand{\Radius}{3} \begin{axis}[height=10cm] \addplot3[surf, domain=0:16.28] ({(\Radius + \radius * cos(y)) * cos(x)}, {(\Radius + \radius * cos(y)) * sin(x)}, {\radius * sin(y)}); \end{axis} \end{tikzpicture} \caption{Torus} \end{figure} \begin{figure} \centering \begin{tikzpicture} \begin{axis}[height=10cm] \addplot3[surf,domain=0:6.28] ({2 * (1 - sin(x)) * cos(x) + (2 - cos(x)) * cos(y) * (2 * exp(0-(x/(2 - pi)^2)) - 1)}, {(2 - cos(x)) * sin(y)}, {6 * sin(x) + 0.5 * (2 - cos(x)) * sin(x) * cos(y) * exp(0-((x - 3 * pi)/2)^2)}); \end{axis} \end{tikzpicture} \caption{Klein'sche Flasche} \end{figure} \begin{figure} \centering \begin{tikzpicture} \begin{axis}[height=10cm] \addplot3[surf,domain=-1:1, y domain=0:6.28] ({cos(y) * (1 + x/2 * cos(y/2))}, {sin(y) * (1 + x/2 * cos(y/2))}, {x/2 * sin(y/2)}); \end{axis} \end{tikzpicture} \caption{M"obiusband} \end{figure} \end{document}
Kurze Frage nebenbei, weil ich dafür nicht ein extra Thema aufmachen möchte: Warum genügt
axis line style={->}
Viele Grüße,
\\ guy.brush