Code:
\documentclass{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{filecontents}
\begin{filecontents}{parameter.dat}
4.451e+004;8.800e+004 %die erste Zahl hier ist zu groß? Die zweite Zahl in der Spalte verwende ich nicht.
-587.839;33.491
-1.215;0.339
696.359;0.0
\end{filecontents}
\begin{filecontents}{messwerte.dat}
961;29
960;30
908;42
906;42
858;48
859;50
808;64
809;65
754;86
744;96
729;110
743;102
716;137
712;121
692;160
689;143
667;253
664;207
\end{filecontents}
\begin{filecontents}{fitting.dat}
# Curve 0 of 1, 100 points
# Curve title: "f(x)"
# x y type
6.6400000e+002;2.3060659e+002;;i
7.0000000e+002;1.4410564e+002;;i
7.2100000e+002;1.1698983e+002;;i
7.4800000e+002;9.3488696e+001;;i
7.5100000e+002;9.1404937e+001;;i
7.9300000e+002;6.9205355e+001;;i
8.3800000e+002;5.4391307e+001;;i
8.6200000e+002;4.8663566e+001;;i
8.8000000e+002;4.5046376e+001;;i
9.0100000e+002;4.1404176e+001;;i
9.2200000e+002;3.8265367e+001;;i
9.4000000e+002;3.5902922e+001;;i
9.5500000e+002;3.4129216e+001;;i
9.6100000e+002;3.3463829e+001;;i
\end{filecontents}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage{lmodern}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepgfplotslibrary{external}
\usetikzlibrary{pgfplots.external}
\tikzexternalize[shell escape=-enable-write18]
\tikzset{external/optimize command away=\myExpensiveMacro}
\tikzsetexternalprefix{PGFPlots/}
\tikzset{external/force remake} %Force Remake of the Graphs!
\newcount\kencounter
\global\kencounter=0
\pgfplotstableset{col sep=semicolon}
\pgfplotsset{
compat=1.5.1,
label style={font=\small},
tick label style={font=\small},
legend style={font=\footnotesize},
every mark/.append style={solid},
every axis/.append style={
% line width=0.1pt,
font=\small,
thick,
tick style={thick,black}
}
}
\pgfkeys{/pgf/number format/.cd,
%fixed,
%fixed zerofill,
%precision=2,
set thousands separator={},
}
\begin{document}
\begin{figure}[H]
\begin{tikzpicture}
\pgfplotsset{log base 10 number format code/.code={$\pgfmathparse{10^(#1)}\pgfmathprintnumber{\pgfmathresult}$}} %um keine 10^x auszugeben
\begin{axis}[
title={},
width=1\textwidth,
height=0.45\textheight,
thick,
xticklabel style = {/pgf/number format/.cd,fixed,precision=0},
yticklabel style = {/pgf/number format/.cd,fixed,precision=0},
%xmin=600,
%xmax=1000,
%ymin=0,
%ymax=100,
xlabel=Temperatur (\si{\celsius}),
ylabel=Zeit (\si{\milli\second}),
tick style={thick,black},
cycle list name=mark list,
%cycle list name=black white,
grid=major,
grid style={dotted,black,thin},
minor tick num=1,
legend cell align=left,
legend style={at={(0.99,0.99)},anchor=north east,font=\small}
]
\addplot+[only marks] table[x index=0,y index=1]{messwerte.dat};
\addlegendentry{Versuchsreihe};
\addplot+[smooth] table[x index=0,y index=1]{fitting.dat};
\addlegendentry{\pgfplotstableread{parameter.dat}\parameters
\pgfplotstablegetelem{0}{0}\of\parameters \pgfmathsetmacro\paramA{\pgfplotsretval}
\pgfplotstablegetelem{1}{0}\of\parameters \pgfmathsetmacro\paramB{\pgfplotsretval}
\pgfplotstablegetelem{2}{0}\of\parameters \pgfmathsetmacro\paramC{\pgfplotsretval}
\pgfplotstablegetelem{3}{0}\of\parameters \pgfmathsetmacro\paramD{\pgfplotsretval}
$\pgfmathprintnumber[sci]{\paramA}\left({x}+{\pgfmathprintnumber{\paramB}}\right)^{\pgfmathprintnumber{\paramC}}$
}
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
Lesezeichen