Ist es möglich, Daten für ein 3D-Diagramm in pgfplots zu extrapolieren?

Ist es möglich, Daten für ein 3D-Diagramm in pgfplots zu extrapolieren?

Ich habe mehrere Messungen zum Plotten und möchte dafür so etwas wie eine 3D-Oberfläche verwenden pgfplots. Als äußere Grenze habe ich einen Rahmen und als Messraster ein Gitter. Die Messwerte werden in der Mitte jeder Gitterzelle aufgenommen. Beim Plotten der gesamten Oberfläche möchte ich die Daten bis zu den äußeren Grenzen des Rahmens extrapolieren, um das Ganze mit der Oberfläche zu füllen.

Hier ist, was ich bisher habe:

\documentclass{standalone}
\usepackage[locale = DE]{siunitx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\SendSettingsToPgf
\pgfplotsset{%
    ,grid style={black, thin}
    ,y label style={rotate=-90}
}

\begin{document}
\begin{tikzpicture}
    \begin{axis}[%
            ,colorbar
            ,view={0}{90}
            ,xmin=0
            ,xmax=3910
            ,ymin=0
            ,ymax=2040
            ,width=391pt
            ,height=204pt
            ,grid=major
            ,xlabel=Width $b_\mathrm{frame}$ in \si{\milli\metre}
            ,ylabel=Height $h_\mathrm{frame}$ in \si{\milli\metre}
        ]
        \addplot3[%
            ,surf
            ,shader=interp
        ] file {data.dat};
    \end{axis}
\end{tikzpicture}
\end{document}

und data.datsieht aus wie:

85  1955    0.97
255 1955    1.86
425 1955    2.44
595 1955    2.23
765 1955    2.17
935 1955    2.35
1105    1955    2.21
1275    1955    2.53
1445    1955    2.58
1615    1955    2.64
1785    1955    2.6
1955    1955    2.03
2125    1955    2.5
2295    1955    2.32
2465    1955    2.22
2635    1955    2
2805    1955    1.59
2975    1955    2.23
3145    1955    2.18
3315    1955    2.07
3485    1955    2.38
3655    1955    2.48
3825    1955    1.42

85  1785    1.3
255 1785    1.41
...

Ich muss also Werte für alle Punkte erhalten x = 0. y = 0Da pgfplotses interpolieren kann, kann es vielleicht auch extrapolieren.

So sieht es aus:

Bildbeschreibung hier eingeben

Zwei zusätzliche Punkte:

  • Ich möchte das Raster (nicht die Striche) auf das Messraster bekommen, sagen wir alle 170 mm
  • Ich möchte die Farbkarte beschriftet bekommen mitspeed $v$ in \si{\metre\per\second}

Antwort1

Zur Hauptfrage:

pgfplotswird ohne integrierte Unterstützung für Extrapolationen geliefert.

Sie müssten sie möglicherweise mithilfe eines externen Produkts berechnen octaveoder matlab.

Antwort2

(Teillösung) Ich kenne diese Funktion leider nicht. Aber ich kann Ihnen bei diesen beiden zusätzlichen Aufgaben helfen. Los geht’s.

\documentclass{standalone}
\usepackage{filecontents}
\usepackage[locale = DE]{siunitx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\SendSettingsToPgf
\pgfplotsset{%
    ,grid style={black, thin}
    ,y label style={rotate=-90}}
\begin{document}
\begin{filecontents*}{data.dat}
85  1955    0.97
255 1955    1.86
425 1955    2.44
595 1955    2.23
765 1955    2.17
935 1955    2.35
1105    1955    2.21
1275    1955    2.53
1445    1955    2.58
1615    1955    2.64
1785    1955    2.6
1955    1955    2.03
2125    1955    2.5
2295    1955    2.32
2465    1955    2.22
2635    1955    2
2805    1955    1.59
2975    1955    2.23
3145    1955    2.18
3315    1955    2.07
3485    1955    2.38
3655    1955    2.48
3825    1955    1.42
85  1785    1.3
255 1785    1.41 
\end{filecontents*}
\begin{tikzpicture}
    \begin{axis}[%
            ,colorbar
            ,view={0}{90}
            ,xmin=0
            ,xmax=3910
            ,ymin=0
            ,ymax=2040
            ,width=391pt
            ,height=204pt
            ,grid=major
            ,xlabel=Width $b_\mathrm{frame}$ in \si{\milli\metre}
            ,ylabel=Height $h_\mathrm{frame}$ in \si{\milli\metre}
,xtick={0,170,...,3910}
,ytick={0,170,...,2040}
,tick style={black}
,x tick label style={rotate=90}
        ]
        \addplot3[
            ,surf, 
            ,shader=interp
        ] file {data.dat};
    \end{axis}
\node[xshift=2mm, yshift=4.5mm, rotate=90] at (current bounding box.east){Speed $v$ in \si{\metre\per\second}};
\end{tikzpicture}
\end{document}

Bildbeschreibung hier eingeben

Bearbeiten:Wir können unser Beispiel erweitern, indem wir große und kleine Markierungen verwenden, um den Effekt zu erzielen, dass das Raster häufiger ist als seine Beschriftungen. Ich habe ein weiteres 3D-Diagramm mit zwei leeren Punkten hinzugefügt, um das Minimum und Maximum auf der Z-Achse zu steuern. Dies wirkt sich auf die Farbkarte aus.

\documentclass{standalone}
\usepackage{filecontents}
\usepackage[locale = DE]{siunitx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\SendSettingsToPgf
\pgfplotsset{%
    ,grid style={black, thin}
    ,y label style={rotate=-90}}
\begin{document}
\begin{filecontents*}{data.dat}
85  1955    0.97
255 1955    1.86
425 1955    2.44
595 1955    2.23
765 1955    2.17
935 1955    2.35
1105    1955    2.21
1275    1955    2.53
1445    1955    2.58
1615    1955    2.64
1785    1955    2.6
1955    1955    2.03
2125    1955    2.5
2295    1955    2.32
2465    1955    2.22
2635    1955    2
2805    1955    1.59
2975    1955    2.23
3145    1955    2.18
3315    1955    2.07
3485    1955    2.38
3655    1955    2.48
3825    1955    1.42
85  1785    1.3
255 1785    1.41 
\end{filecontents*}
\begin{tikzpicture}
    \begin{axis}[%
            ,colorbar
            ,view={0}{90}
            ,xmin=0
            ,xmax=3910
            ,ymin=0
            ,ymax=2040
            ,width=391pt
            ,height=204pt
            ,grid=minor
            ,xlabel=Width $b_\mathrm{frame}$ in \si{\milli\metre}
            ,ylabel=Height $h_\mathrm{frame}$ in \si{\milli\metre}
,minor xtick={0,170,...,5000}
,minor ytick={0,170,...,5000}
,xtick={0,500,...,5000}
,ytick={0,500,...,5000}
,tick style={black}
%,x tick label style={rotate=90}
        ]
\addplot3[surf, shader=interp] file {data.dat};
\addplot3[surf] coordinates {(0, 0, 0) (0, 0, 3)};
    \end{axis}
\node[xshift=2mm, yshift=4.5mm, rotate=90] at (current bounding box.east){Speed $v$ in \si{\metre\per\second}};
\end{tikzpicture}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen