PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : tikzpicture mit subplots und gemeinsamer Achse



Bert444
16-07-2013, 22:09
Kennt jemmand eine Möglichkeit via tikezpicture bzw. Latex für alle subplots eine gemeinsame Achsenbeschriftung zu erzeugen (x, y Achse)?
Ziel wäre etw. das Angehängte Bild. Wäre für Tipps dankbar.


\documentclass[ngerman]{scrartcl}
\usepackage[english,ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel,csquotes}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{mathtext}
\usepackage{pgfplots}
\newlength\figureheight
\newlength\figurewidth
\begin{document}
\begin{figure}[h!tbp]
\centering
\setlength\figureheight{2cm}
\setlength\figurewidth{2cm}
\input{./VTest.tex}
\caption[Test-Bild ]{Test-Bild\label{fig.test3}}
\end{figure}
\end{document}


VTest.tex



\begin{tikzpicture}
\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot6
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,0.0018139947929278)
(1,0.00302356546437155)
(2,0.00299321208343244)
(3,0.0042021538195713)
(4,0.0141772124351011)
(5,0.00153876389961807)
(6,0.0189039280090916)
(7,0.0168022027526157)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot2,
at=(plot6.above north west),
anchor=below south west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,8.04364376195342e-09)
(1,2.21849779042059e-09)
(2,6.6641986346388e-09)
(3,5.34996920796103e-09)
(4,8.42267487903675e-09)
(5,7.41214711683553e-09)
(6,1.02320478280527e-08)
(7,9.31594555348345e-09)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot1,
at=(plot2.left of south west),
anchor=right of south east
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,0.00416621282850607)
(1,0.00485459582086611)
(2,0.00598714078591125)
(3,0.00791040745475371)
(4,0.0101689356825918)
(5,0.0117733175345955)
(6,0.0163049154444278)
(7,0.0293207626425874)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot5,
at=(plot1.below south west),
anchor=above north west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,1.27329393208413e-09)
(1,1.11580111687006e-10)
(2,1.10490766241325e-09)
(3,5.47745721394056e-10)
(4,2.16682579715435e-09)
(5,1.18561148410523e-09)
(6,2.54278354352082e-09)
(7,3.7117706020008e-09)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot9,
at=(plot5.below south west),
anchor=above north west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,0.0130049595548827)
(1,0.00475957737685901)
(2,0.00244567760098355)
(3,0.00568124280073013)
(4,0.0020081849105993)
(5,0.00490228993615818)
(6,0.00319393497116393)
(7,0.00304548131877135)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot10,
at=(plot9.right of south east),
anchor=left of south west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,6.47690109173132e-08)
(1,2.00295835300042e-07)
(2,2.25023148395546e-07)
(3,1.73746705496574e-07)
(4,2.25663431235406e-07)
(5,8.00001786052982e-08)
(6,1.83035205213414e-08)
(7,3.35358843902934e-08)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot11,
at=(plot10.right of south east),
anchor=left of south west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,0.0173264703922256)
(1,0.0164219050646478)
(2,0.0188679069478298)
(3,0.0247415932670325)
(4,0.0324330438465549)
(5,0.0365080553348768)
(6,0.0443675711755923)
(7,0.0687221277138424)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot7,
at=(plot11.above north west),
anchor=below south west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,3.77570769584297e-08)
(1,4.46751148286367e-08)
(2,5.94029582775913e-08)
(3,9.97624526230883e-08)
(4,5.99418062517665e-08)
(5,5.16794276762445e-08)
(6,3.45882410290755e-08)
(7,9.08173053757647e-08)
(8,8.30851284257766e-08)
(9,3.85492438940732e-08)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot3,
at=(plot7.above north west),
anchor=below south west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,0.00322178441369429)
(1,0.00345089489383663)
(2,0.00371641204000398)
(3,0.00395395036474371)
(4,0.00424468968237215)
(5,0.00454764942340434)
(6,0.00486999545631336)
(7,0.00526149701239172)
(8,0.00566421135854655)
(9,0.00609043791577446)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot4,
at=(plot3.right of south east),
anchor=left of south west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,5.97451776747256e-09)
(1,6.28942566809495e-09)
(2,7.06794124219453e-09)
(3,7.51918926115495e-09)
(4,9.37974544078365e-09)
(5,8.2880569732099e-09)
(6,1.36513403640362e-08)
(7,1.54225072084152e-08)
(8,1.60239864764511e-08)
(9,2.33878467252947e-08)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot8,
at=(plot4.below south west),
anchor=above north west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,8.8401605337903e-15)
(1,7.8536121733096e-15)
(2,1.23038377484997e-14)
(3,1.23007746123866e-14)
(4,9.39562906949172e-15)
(5,1.00994568800011e-14)
(6,6.55184847818868e-15)
(7,1.57532331710354e-14)
(8,1.53782886106766e-14)
(9,6.24679252952756e-15)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot12,
at=(plot8.below south west),
anchor=above north west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,1.0312660255893e-07)
(1,7.93880719179328e-09)
(2,2.69041796844449e-08)
(3,2.47787271550513e-08)
(4,1.0670488005384e-07)
(5,4.63863252414403e-09)
(6,3.30233645868599e-08)
(7,3.45406205214368e-08)
(8,1.12525556373245e-07)
(9,1.09475579706517e-08)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot16,
at=(plot12.below south west),
anchor=above north west
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,0.0115345320415884)
(1,0.0117199363105483)
(2,0.0122826465787432)
(3,0.0200827630860673)
(4,0.0269293079361472)
(5,0.02509087729009)
(6,0.0392746682537502)
(7,0.050454905485114)
(8,0.0421337120112076)
(9,0.0817163222101489)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot15,
at=(plot16.left of south west),
anchor=right of south east
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,1.2049666936787e-07)
(1,1.14261382220579e-07)
(2,1.09636120467362e-07)
(3,1.03101166195763e-07)
(4,9.82692407453182e-08)
(5,9.17231922830434e-08)
(6,8.46671413238893e-08)
(7,7.57465695148498e-08)
(8,7.58939428141455e-08)
(9,5.79955699055354e-08)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
name=plot14,
at=(plot15.left of south west),
anchor=right of south east
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,1.09071738777951e-14)
(1,3.14008728942603e-14)
(2,3.26719574916321e-14)
(3,2.58189762741755e-14)
(4,2.90279708220434e-14)
(5,1.53269340227416e-14)
(6,9.77557732884124e-15)
(7,7.40903170491312e-15)
(8,1.91281064749115e-14)
(9,1.33566929272737e-14)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}

\begin{axis}[%
/pgf/number format/.cd,
use comma,
1000 sep={},
set decimal separator={,},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=-0.1,
xmax=25,
xmajorgrids,
ymin=-0,
ymax=1.37385180876472,
ymajorgrids,
at=(plot14.left of south west),
anchor=right of south east
]
\addplot[ycomb,color=black,solid,line width=1.0pt,mark=o,mark options={solid}] plot coordinates{(0,2.39887053980695e-08)
(1,9.67376828175383e-09)
(2,1.34270399472936e-08)
(3,1.64816866615507e-08)
(4,2.55971339093043e-08)
(5,8.09975284020757e-09)
(6,1.38938343322949e-08)
(7,1.5817930700019e-08)
(8,2.64235515705691e-08)
(9,9.1541721145409e-09)
};

\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
-0.1 0\\
25 0\\
};
\end{axis}
\end{tikzpicture}%

Bert444
16-07-2013, 22:38
Eventuell mit der Picture Umgebung?

bobmalaria
16-07-2013, 23:15
hi,

nein das kannst du doch mit tikz machen! pgfplots basiert ja auf tikz. allerdings würde ich dir erstmal empfehlen die groupplot library zu verweden.

hier mal ein ansatz. ein bisschen zusammen gehackt aber funktioniert ganz ok


\documentclass{article}

\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}

\usepackage{lipsum}

\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={group name=my plots,
group size=2 by 2},
width=4cm,
height=4cm]
\nextgroupplot
\addplot coordinates{(0,0) (1,2) (2,1)};
\nextgroupplot
\addplot coordinates{(0,0) (1,2) (2,1)};
\nextgroupplot
\addplot coordinates {(0,0) (1,2) (2,1)};
\nextgroupplot
\addplot coordinates {(0,0) (1,2) (2,1)};
\end{groupplot}

\path(my plots c1r1.north west) -- (my plots c1r2.south west) node (m) [midway,xshift=-18pt,rotate=90,anchor=east] {hier};
\draw[->] (m.east)-- ++(up:1cm);
\end{tikzpicture}


\end{document}

vielleocht weiss jemand was mit besserer automatisierung

http://www.mrunix.de/forums/attachment.php?attachmentid=5786&stc=1&d=1374009368