Seite 1 von 1

PGFPLOTS-Achsen Stellenweise vergrössern

Verfasst: Sa 4. Jun 2016, 21:41
von feuerfalke2005
Hallo liebe Forenmitglieder.

Könnte mir von euch jemand sagen wie ich einen Achsen Abschnittsweise vergrössern war.
Ich würde gerne einen Graphen darstellen der zwischen den Zahlen -2 und -3 eine Grössere Auflösung darstellen.
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}[
width=12cm,
height=4cm,
scale only axis,
xmin=0,
xmax=20,
xlabel={Kraft [kN]},
ymin=-6,
ymax=0,
ylabel={Setzungen $\Delta$h2 [mm]},
axis x line*=top, %bottom, %top,
axis y line*=left
]
\addplot [
color= blue,
line width=1.5pt,
mark size=2.0pt,
%only marks,
mark=ball,
mark options={solid},
forget plot
]
table[row sep=crcr]{
	0 0\\
	5.09 -0.85   \\
	7.50 -1.66   \\
	9.90 -2.19   \\
	12.30 -2.85  \\
	8.46 -2.84   \\
	3.84 -2.67   \\
	6.15 -2.74   \\
	9.61 -2.84   \\
	13.07 -3.20  \\
	16.53 -4.79  \\ 
	21.14 -6.48  \\
%	26.91 -8.26  \\
%	38.44 -14.28 \\ 
%	57.66 -22.34 \\
%	79.19 -32.18 \\
%	0 0.384\\
%	0 -20\\ 
};
\draw [very thick,red](0.384,0) -- (0.384,-6);
\end{axis}
\end{tikzpicture}\vspace{-2ex}
\caption{Kraftsetzungs Diagramm}
\label{KraftSetzDia}
\end{figure}
\end{document}
Bild

Danke für Eure Hilfe
Bin in der Letzten zeit viel im Forum und lese mir viel hilfreich ding durch
Ich danke euch allen sehr für eure unterstützung

Verfasst: So 5. Jun 2016, 20:48
von esdd
Du könntest einen groupplot verwenden, in dem unterhalb des ersten Plots ein vergrößerter Ausschnitt dargestellt wird.
\begin{filecontents*}{data.dat}
0 0 
5.09 -0.85    
7.50 -1.66    
9.90 -2.19    
12.30 -2.85   
8.46 -2.84    
3.84 -2.67    
6.15 -2.74    
9.61 -2.84    
13.07 -3.20   
16.53 -4.79   
21.14 -6.48   
%26.91 -8.26   
%38.44 -14.28   
%57.66 -22.34  
%79.19 -32.18  
%0 0.384 
%0 -20  
\end{filecontents*}


\documentclass[margin=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}% newest für Online-Editor, sonst derzeit 1.13
\usepackage{pgfplotstable}
\usepgfplotslibrary{groupplots}
\begin{document}
\begin{tikzpicture}
 \begin{groupplot}[
     group style = {
      group size = 1 by 2,
      xlabels at= edge top
     },
     width = 12cm,
     scale only axis, 
     xmin=0, 
     xmax=20, 
     xlabel={Kraft [kN]}, 
     ylabel={Setzungen $\Delta$h2 [mm]}, 
     axis x line*=top, %bottom, %top, 
     axis y line*=left,
     every axis plot/.append style={
      line width=1.5pt,
      mark size=2pt,
      mark=ball,
      mark options=solid,
      forget plot
     }
    ]
    \nextgroupplot[height=4cm,ymin=-6,ymax=0]
      \addplot [color= blue] table{data.dat};
      \draw[orange,dashed,thick](0,-4)rectangle(20,-2);
      \coordinate(s)at(10,-4);
      
    \nextgroupplot[height=6cm,ymin=-3.2,ymax=-2.5]
      \addplot [color= blue] table{data.dat};
  \end{groupplot}
  
  \draw[very thick, orange, ->, shorten >=2pt+\baselineskip, shorten <=2pt] (s)
  -- (group c1r2.north);
\end{tikzpicture}
\end{document}
Bild

Verfasst: So 5. Jun 2016, 21:07
von feuerfalke2005
Danke
Genau was ich gesucht habe


Danke