Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 5

16 Feb '16, 11:57

Henri's gravatar image

Henri
15.7k133943

Man muss leider jede Spalte einzeln plotten, aber man kann mit `\pgfplotsinvokeforeach` einfach über die Spalten der Tabelle iterieren. Für die y-Achse bietet sich die Bibliothek `dateplot` an. \documentclass{article} \usepackage{pgfplots,pgfplotstable} \usepgfplotslibrary{dateplot} \pgfplotstableread[col sep=comma]{ 2013-12-01, 0.13, 0.24, 0.44, 0.69, 0.95, 1.21, 1.47, 1.7, 1.92, 2.11 2014-01-01, 0.06, 0.08, 0.2, 0.39, 0.61, 0.85, 1.09, 1.32, 1.53, 1.73 2014-02-01, 0.08, 0.11, 0.23, 0.4, 0.61, 0.83, 1.06, 1.27, 1.48, 1.67 2014-03-01, 0.13, 0.14, 0.25, 0.41, 0.61, 0.82, 1.04, 1.26, 1.46, 1.65 2014-04-01, 0.13, 0.15, 0.25, 0.41, 0.6, 0.81, 1.02, 1.23, 1.43, 1.61 2014-05-01, 0.05, 0.04, 0.13, 0.27, 0.44, 0.64, 0.84, 1.04, 1.24, 1.42 2014-06-01, 0, 0.01, 0.09, 0.22, 0.38, 0.57, 0.76, 0.95, 1.14, 1.31 }\loadedtable \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel = Spalte, ylabel = Datum, zlabel = Zins, date coordinates in=y, yticklabel={\day.\month.\year}, x dir=reverse ] \pgfplotstablegetcolsof\loadedtable \pgfmathparse{int(\pgfplotsretval-2)} \pgfmathparse{int(\pgfplotsretval-1)} \pgfplotsinvokeforeach{1,...,\pgfmathresult}{ \addplot3[scatter,only marks] table[x expr=#1, y index=0, z index=#1] {\loadedtable}; } \end{axis} \end{tikzpicture} \end{document} > ![alt text][1] Um eine geschlossene Oberfläche plotten zu können muss man die Daten umformatieren. \documentclass{article} \usepackage{pgfplots,pgfplotstable} \usepgfplotslibrary{dateplot} \pgfplotstableread[col sep=comma]{ 2013-12-01, 1, 0.13 2013-12-01, 2, 0.24 2013-12-01, 3, 0.44 2013-12-01, 4, 0.69 2013-12-01, 5, 0.95 2013-12-01, 6, 1.21 2013-12-01, 7, 1.47 2013-12-01, 8, 1.7 2013-12-01, 9, 1.92 2013-12-01, 10, 2.11 2014-01-01, 1, 0.06 2014-01-01, 2, 0.08 2014-01-01, 3, 0.2 2014-01-01, 4, 0.39 2014-01-01, 5, 0.61 2014-01-01, 6, 0.85 2014-01-01, 7, 1.09 2014-01-01, 8, 1.32 2014-01-01, 9, 1.53 2014-01-01, 10, 1.73 2014-02-01, 1, 0.08 2014-02-01, 2, 0.11 2014-02-01, 3, 0.23 2014-02-01, 4, 0.4 2014-02-01, 5, 0.61 2014-02-01, 6, 0.83 2014-02-01, 7, 1.06 2014-02-01, 8, 1.27 2014-02-01, 9, 1.48 2014-02-01, 10, 1.67 2014-03-01, 1, 0.13 2014-03-01, 2, 0.14 2014-03-01, 3, 0.25 2014-03-01, 4, 0.41 2014-03-01, 5, 0.61 2014-03-01, 6, 0.82 2014-03-01, 7, 1.04 2014-03-01, 8, 1.26 2014-03-01, 9, 1.46 2014-03-01, 10, 1.65 2014-04-01, 1, 0.13 2014-04-01, 2, 0.15 2014-04-01, 3, 0.25 2014-04-01, 4, 0.41 2014-04-01, 5, 0.6 2014-04-01, 6, 0.81 2014-04-01, 7, 1.02 2014-04-01, 8, 1.23 2014-04-01, 9, 1.43 2014-04-01, 10, 1.61 2014-05-01, 1, 0.05 2014-05-01, 2, 0.04 2014-05-01, 3, 0.13 2014-05-01, 4, 0.27 2014-05-01, 5, 0.44 2014-05-01, 6, 0.64 2014-05-01, 7, 0.84 2014-05-01, 8, 1.04 2014-05-01, 9, 1.24 2014-05-01, 10, 1.42 2014-06-01, 1, 0 2014-06-01, 2, 0.01 2014-06-01, 3, 0.09 2014-06-01, 4, 0.22 2014-06-01, 5, 0.38 2014-06-01, 6, 0.57 2014-06-01, 7, 0.76 2014-06-01, 8, 0.95 2014-06-01, 9, 1.14 2014-06-01, 10, 1.31 }\loadedtable \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel = Spalte, ylabel = Datum, zlabel = Zins, date coordinates in=y, yticklabel={\day.\month.\year}, x dir=reverse ] \addplot3[surf,mesh/cols=10] table[x index=1, y index=0, z index=2] {\loadedtable}; \end{axis} \end{tikzpicture} \end{document} > ![alt text][2] Man kann auch nette Kombinationen bauen --- \addplot3[mesh,scatter,mesh/cols=10] table[x index=1, y index=0, z index=2] {\loadedtable}; > ![alt text][3] --- \addplot3[surf,shader=interp,scatter,mesh/cols=10] table[x index=1, y index=0, z index=2] {\loadedtable}; > ![alt text][4] --- \addplot3[surf,scatter,mesh/cols=10,fill=white] table[x index=1, y index=0, z index=2] {\loadedtable}; > ![alt text][5] [1]: http://texwelt.de/wissen/upfiles/test_73.png http://texwelt.de/wissen/upfiles/test_79.png [2]: http://texwelt.de/wissen/upfiles/test_75.png [3]: http://texwelt.de/wissen/upfiles/test_76.png [4]: http://texwelt.de/wissen/upfiles/test_77.png [5]: http://texwelt.de/wissen/upfiles/test_78.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 4

16 Feb '16, 11:45

Henri's gravatar image

Henri
15.7k133943

Man muss leider jede Spalte einzeln plotten, aber man kann mit `\pgfplotsinvokeforeach` einfach über die Spalten der Tabelle iterieren. Für die y-Achse bietet sich die Bibliothek `dateplot` an. \documentclass{article} \usepackage{pgfplots,pgfplotstable} \usepgfplotslibrary{dateplot} \pgfplotstableread[col sep=comma]{ 2013-12-01, 0.13, 0.24, 0.44, 0.69, 0.95, 1.21, 1.47, 1.7, 1.92, 2.11 2014-01-01, 0.06, 0.08, 0.2, 0.39, 0.61, 0.85, 1.09, 1.32, 1.53, 1.73 2014-02-01, 0.08, 0.11, 0.23, 0.4, 0.61, 0.83, 1.06, 1.27, 1.48, 1.67 2014-03-01, 0.13, 0.14, 0.25, 0.41, 0.61, 0.82, 1.04, 1.26, 1.46, 1.65 2014-04-01, 0.13, 0.15, 0.25, 0.41, 0.6, 0.81, 1.02, 1.23, 1.43, 1.61 2014-05-01, 0.05, 0.04, 0.13, 0.27, 0.44, 0.64, 0.84, 1.04, 1.24, 1.42 2014-06-01, 0, 0.01, 0.09, 0.22, 0.38, 0.57, 0.76, 0.95, 1.14, 1.31 }\loadedtable \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel = Spalte, ylabel = Datum, zlabel = Zins, date coordinates in=y, yticklabel={\day.\month.\year}, x dir=reverse ] \pgfplotstablegetcolsof\loadedtable \pgfmathparse{int(\pgfplotsretval-2)} \pgfplotsinvokeforeach{1,...,\pgfmathresult}{ \addplot3[scatter,only marks] table[x expr=#1, y index=0, z index=#1] {\loadedtable}; } \end{axis} \end{tikzpicture} \end{document} > ![alt text][1] Um eine geschlossene Oberfläche plotten zu können muss man die Daten umformatieren. \documentclass{article} \usepackage{pgfplots,pgfplotstable} \usepgfplotslibrary{dateplot} \pgfplotstableread[col sep=comma]{ 2013-12-01, 1, 0.13 2013-12-01, 2, 0.24 2013-12-01, 3, 0.44 2013-12-01, 4, 0.69 2013-12-01, 5, 0.95 2013-12-01, 6, 1.21 2013-12-01, 7, 1.47 2013-12-01, 8, 1.7 2013-12-01, 9, 1.92 2013-12-01, 10, 2.11 2014-01-01, 1, 0.06 2014-01-01, 2, 0.08 2014-01-01, 3, 0.2 2014-01-01, 4, 0.39 2014-01-01, 5, 0.61 2014-01-01, 6, 0.85 2014-01-01, 7, 1.09 2014-01-01, 8, 1.32 2014-01-01, 9, 1.53 2014-01-01, 10, 1.73 2014-02-01, 1, 0.08 2014-02-01, 2, 0.11 2014-02-01, 3, 0.23 2014-02-01, 4, 0.4 2014-02-01, 5, 0.61 2014-02-01, 6, 0.83 2014-02-01, 7, 1.06 2014-02-01, 8, 1.27 2014-02-01, 9, 1.48 2014-02-01, 10, 1.67 2014-03-01, 1, 0.13 2014-03-01, 2, 0.14 2014-03-01, 3, 0.25 2014-03-01, 4, 0.41 2014-03-01, 5, 0.61 2014-03-01, 6, 0.82 2014-03-01, 7, 1.04 2014-03-01, 8, 1.26 2014-03-01, 9, 1.46 2014-03-01, 10, 1.65 2014-04-01, 1, 0.13 2014-04-01, 2, 0.15 2014-04-01, 3, 0.25 2014-04-01, 4, 0.41 2014-04-01, 5, 0.6 2014-04-01, 6, 0.81 2014-04-01, 7, 1.02 2014-04-01, 8, 1.23 2014-04-01, 9, 1.43 2014-04-01, 10, 1.61 2014-05-01, 1, 0.05 2014-05-01, 2, 0.04 2014-05-01, 3, 0.13 2014-05-01, 4, 0.27 2014-05-01, 5, 0.44 2014-05-01, 6, 0.64 2014-05-01, 7, 0.84 2014-05-01, 8, 1.04 2014-05-01, 9, 1.24 2014-05-01, 10, 1.42 2014-06-01, 1, 0 2014-06-01, 2, 0.01 2014-06-01, 3, 0.09 2014-06-01, 4, 0.22 2014-06-01, 5, 0.38 2014-06-01, 6, 0.57 2014-06-01, 7, 0.76 2014-06-01, 8, 0.95 2014-06-01, 9, 1.14 2014-06-01, 10, 1.31 }\loadedtable \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel = Spalte, ylabel = Datum, zlabel = Zins, date coordinates in=y, yticklabel={\day.\month.\year}, x dir=reverse ] \addplot3[surf,mesh/cols=10] table[x index=1, y index=0, z index=2] {\loadedtable}; \end{axis} \end{tikzpicture} \end{document} > ![alt text][2] Man kann auch nette Kombinationen bauen --- \addplot3[mesh,scatter,mesh/cols=10] table[x index=1, y index=0, z index=2] {\loadedtable}; > ![alt text][3] --- \addplot3[surf,shader=interp,scatter,mesh/cols=10] table[x index=1, y index=0, z index=2] {\loadedtable}; > ![alt text][4] --- \addplot3[surf,scatter,mesh/cols=10,fill=white] table[x index=1, y index=0, z index=2] {\loadedtable}; > ![alt text][5] [1]: http://texwelt.de/wissen/upfiles/test_73.png [2]: http://texwelt.de/wissen/upfiles/test_75.pnghttp://texwelt.de/wissen/upfiles/test_75.png [3]: http://texwelt.de/wissen/upfiles/test_76.png [4]: http://texwelt.de/wissen/upfiles/test_77.png [5]: http://texwelt.de/wissen/upfiles/test_78.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 3

16 Feb '16, 11:29

Henri's gravatar image

Henri
15.7k133943

Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

16 Feb '16, 11:27

Henri's gravatar image

Henri
15.7k133943

Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

16 Feb '16, 11:14

Henri's gravatar image

Henri
15.7k133943