![Wie kann man xmin und xmax für kleine Intervalle zum Laufen bringen?](https://rvso.com/image/309868/Wie%20kann%20man%20xmin%20und%20xmax%20f%C3%BCr%20kleine%20Intervalle%20zum%20Laufen%20bringen%3F.png)
Im Folgenden wird eine kleine Stichprobe aus einem großen Datensatz verwendet, der durch x = 0 und x = 2 begrenzt ist. Allerdings besteht die Notwendigkeit, die Ergebnisse im Intervall [1,371508664312009 1,371508780212562] darzustellen. Dies funktioniert jedoch mit dem folgenden Code nicht. Was ist falsch? (Ich könnte das Ergebnis natürlich skalieren, aber ich möchte eine allgemeinere Lösung, da dies in meiner Abschlussarbeit ziemlich oft vorkommt.)
\documentclass[tikz,border=2pt,png]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
cycle list={%
{black}
},
xmin = 1.371508664312009,
xmax = 1.371508780212562,
]
\addplot[unbounded coords=discard] table[x=k,y=F_k] {
k F_k
1.371508647597729 4.218629299064943
1.371508655954869 4.367306455608867
1.371508664312009 4.546736697704027
1.371508672669148 4.767650229729832
1.371508710724181 7.117825185499241
1.371508713560441 7.513271582940213
1.371508716396702 7.985684237353307
1.371508719232962 8.552417433810986
1.371508722069223 9.245525102110591
1.371508724905483 10.115770661107760
1.371508727741744 11.225899722988125
1.371508730578004 12.667837277184283
1.371508737113507 17.998622084719759
1.371508738663157 19.703601372911169
1.371508739179707 20.274665134457187
1.371508739696257 20.825915113218606
1.371508742279008 22.855385665696630
1.371508742795558 22.988513291704997
1.371508745120034 21.959402178915621
1.371508745636584 21.414072973829519
1.371508746153134 20.769375301115637
1.371508746669684 20.063715232649155
1.371508763194999 5.048020735228436
1.371508766031260 4.141215569327951
};
\end{axis}
\end{tikzpicture}
\end{document}
Antwort1
Dies funktioniert nicht, auch wenn Sie das fpu-Format verwenden. Beachten Sie die Warnung nach der Konvertierung durchpgfplots
\documentclass{beamer}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\pgfkeys{/pgf/fpu}
\pgfmathfloatparsenumber{1.371508664312009}\xdef\myxmin{\pgfmathresult}
\pgfmathfloatparsenumber{1.371508780212562}\xdef\myxmax{\pgfmathresult}
\pgfkeys{/pgf/fpu=false}
\begin{axis}[,
cycle list={%
{black}
},enlargelimits=false,
xmin = \myxmin,
xmax = \myxmax,
]
\addplot[unbounded coords=discard] table[x=k,y=F_k] {
k F_k
1.371508647597729 4.218629299064943
1.371508655954869 4.367306455608867
1.371508664312009 4.546736697704027
1.371508672669148 4.767650229729832
1.371508710724181 7.117825185499241
1.371508713560441 7.513271582940213
1.371508716396702 7.985684237353307
1.371508719232962 8.552417433810986
1.371508722069223 9.245525102110591
1.371508724905483 10.115770661107760
1.371508727741744 11.225899722988125
1.371508730578004 12.667837277184283
1.371508737113507 17.998622084719759
1.371508738663157 19.703601372911169
1.371508739179707 20.274665134457187
1.371508739696257 20.825915113218606
1.371508742279008 22.855385665696630
1.371508742795558 22.988513291704997
1.371508745120034 21.959402178915621
1.371508745636584 21.414072973829519
1.371508746153134 20.769375301115637
1.371508746669684 20.063715232649155
1.371508763194999 5.048020735228436
1.371508766031260 4.141215569327951
};
\end{axis}
\end{tikzpicture}
\end{document}
und die Protokolldatei enthält die Warnung:
Paket pgfplots Warnung: Der Achsenbereich für die Achse x ist ungefähr leer; er wird in Eingabezeile 46 vergrößert (er beträgt [1,3715086000000000:1,371508 8000000000]).
[Warnung /pgfplots/Warnung/Ungefährer leerer Bereich vergrößert]
Wenn Sie diese Genauigkeit wirklich benötigen, entfernen Sie den konstanten Teil, nehmen Sie dann das Protokoll Ihrer Daten und stellen Sie es dar. Dies funktioniert eigentlich in keiner Sprache ohne dedizierte Small-Int- und Big-Int-Bibliotheken richtig.