Pgfplots/ - Achsen mit "disconuity" - Ausgabe zu w

Tabellen und Grafiken erstellen und anordnen


Jürgen

Pgfplots/ - Achsen mit "disconuity" - Ausgabe zu w

Beitrag von Jürgen »

Hallo,

ich möchte eine Funktion plotten und die discontinuity Otion benutzen. Leider wird die Grafik viel zu weit rechts positioniert. Es ist nur ca. 5% der Grafik auf dem Blatt zu sehen. Schalte ich die discontinuity OPtion ab, ist alles in Ordnung.


Ich benutze MikTeX 2.9 und Pgfplots 1.7

Vielleicht kann mir jemand helfen.

Viele Grüße, Jürgen

Beispiel:
\documentclass[12pt,a4]{scrartcl}
\usepackage{amsmath,amssymb}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}\usepackage{tikz}
\usepackage{pgfplots} \pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
	axis y discontinuity=parallel,
	xmin=0, 
	xmax=2.2, 
	ymin=2.2,
	ymax=2.55,
	axis x line=bottom,
	x axis  line style={-latex},
	axis y line =left,
	y axis  line style={-latex},
	legend cell align=left,
	legend pos=outer  north east,
	]
\addplot 
	[ 
	samples=200
	] {
    2*3.141*sqrt((1/3*2.2243*(2.05)^2+0.322*x^2)/(9.81*(1/2*2.2243*2.05+0.322*x)))
	};
%\addlegendentry{Theorie}
\end{axis}
\end{tikzpicture}
\end{document}

Epllus
Forum-Guru
Forum-Guru
Beiträge: 470
Registriert: So 23. Sep 2012, 17:31

Beitrag von Epllus »

Versuch es ma hiermit:
\begin{tikzpicture} 
\begin{axis}[ 
   axis y discontinuity=parallel, 
   xmin=0, 
   xmax=2.2, 
   ymin=2.2, 
   ymax=2.55, 
   axis x line=bottom, 
   x axis  line style={-latex}, 
   axis y line =left, 
   y axis  line style={-latex}, 
   legend cell align=left, 
   legend pos=outer  north east, 
   ] 
\addplot 
   [ 
   samples=200, domain=0:2.2 
   ] { 
    2*3.141*sqrt((1/3*2.2243*(2.05)^2+0.322*x^2)/(9.81*(1/2*2.2243*2.05+0.322*x))) 
   }; 
%\addlegendentry{Theorie} 
\end{axis} 
\end{tikzpicture} 
Ich habe eigentlich nur
domain=0:2.2
eingefügt;
bei mir behob diese zusätzliche Zeile das Problem (frag mich nicht warum).

Hoffe es hilft,
Epllus.

Jürgen

Beitrag von Jürgen »

Vielen Dank,

der Tipp hat bei mir geholfen.

Viele Grüße,
Jürgen.

Antworten