Thu, 07 Nov 2024 12:02:24 -0500
tan-mod based exp attempt
| 21 | 1 | \documentclass[tikz]{standalone} |
| 2 | \usepackage{pgfplots} | |
| 3 | \usepackage{tikz-3dplot} | |
| 24 | 4 | \usepackage[svgnames]{xcolor} |
| 21 | 5 | \usepgfplotslibrary{colorbrewer} |
| 6 | ||
| 7 | \def\datapath{../res/} | |
| 8 | ||
| 9 | \begin{document} | |
| 10 | ||
| 11 | \tdplotsetmaincoords{50}{25} | |
| 12 | ||
| 13 | \def\onlyfront#1{ | |
| 14 | \ifnum#1=2\else\ifnum#1=4\else\ifnum#1=6\else | |
| 15 | \def\pgfmathresult{} | |
| 16 | \fi\fi\fi} | |
| 17 | ||
| 18 | \def\onlyback#1{ | |
| 19 | \ifnum#1=1\else\ifnum#1=3\else\ifnum#1=5\else | |
| 20 | \def\pgfmathresult{} | |
| 21 | \fi\fi\fi} | |
| 22 | ||
| 23 | \pgfplotsset{ | |
| 24 | % forget plot = no legend | |
| 25 | cube/.style = {thick, gray!50!black,forget plot}, | |
| 24 | 26 | onlyfront/.code = \pgfplotsset{x filter/.code={\onlyfront{\thisrow{face}}}}, |
| 27 | onlyback/.code = \pgfplotsset{x filter/.code={\onlyback{\thisrow{face}}}}, | |
| 21 | 28 | data/.style = {mark=*, blue, only marks}, |
| 29 | backdata/.style = {mark=*, blue!30!white, only marks, onlyback, forget plot}, | |
| 24 | 30 | iter1/.style = {mark=x, red}, |
| 31 | iter2/.style = {mark=star, BlueViolet}, | |
| 32 | iter3/.style = {mark=asterisk, purple}, | |
| 33 | backiter1/.style = {mark=x, red!30!white, onlyback, forget plot}, | |
| 34 | backiter2/.style = {mark=star, BlueViolet!30!white, onlyback, forget plot}, | |
| 35 | backiter3/.style = {mark=asterisk, purple!30!white, onlyback, forget plot}, | |
| 21 | 36 | origin/.style = {mark=o, green, only marks, thick}, |
| 37 | surfstyle/.style = {very nearly opaque, forget plot}, | |
| 38 | legend style = { | |
| 39 | inner sep = 0pt, | |
| 40 | outer xsep = 5pt, | |
| 41 | outer ysep = 0pt, | |
| 42 | legend cell align = left, | |
| 43 | align = left, | |
| 44 | draw = none, | |
| 45 | fill = none, | |
| 46 | font = \small | |
| 47 | }, | |
| 23 | 48 | illustr3d/.style = { |
| 49 | axis equal, | |
| 50 | width=5cm, | |
| 51 | height=5cm, | |
| 52 | scale only axis, | |
| 53 | enlargelimits=false, | |
| 21 | 54 | colormap access=map, |
| 28 | 55 | colormap/Paired, |
| 21 | 56 | colorbar, |
| 57 | point meta rel=axis wide, | |
| 28 | 58 | shader = flat mean, |
| 21 | 59 | xlabel = {$x$}, |
| 60 | ylabel = {$y$}, | |
| 61 | zlabel = {$z$}, | |
| 62 | ticks = none, | |
| 63 | axis line style = {draw=none}, | |
| 64 | %axis x line = none, | |
| 65 | %axis y line = none, | |
| 66 | %axis z line = none, | |
| 67 | legend columns = 3, | |
| 68 | legend style = { | |
| 24 | 69 | at = {(0.5, 1.1)}, |
| 21 | 70 | anchor = north, |
| 71 | column sep = 1ex, | |
| 72 | }, | |
| 24 | 73 | mark size=1.5pt, |
| 23 | 74 | } |
| 75 | } | |
| 21 | 76 | |
| 23 | 77 | \begin{tikzpicture} |
| 78 | \begin{axis}[illustr3d] | |
| 21 | 79 | \addplot3[cube] coordinates {(0, 0, 0) (0, 1, 0) (0, 1, 1) }; |
| 80 | \addplot3[cube] coordinates {(0, 1, 0) (1, 1, 0) }; | |
| 81 | \addplot3[backdata] table[x=x,y=y,z=z] {\datapath/data.csv}; | |
| 24 | 82 | \addplot3[backiter1] table[x=x,y=y,z=z] {\datapath/x1_log.csv}; |
| 83 | \addplot3[backiter2] table[x=x,y=y,z=z] {\datapath/x2_log.csv}; | |
| 84 | \addplot3[backiter3] table[x=x,y=y,z=z] {\datapath/x3_log.csv}; | |
| 21 | 85 | |
| 86 | \addplot3[ | |
| 87 | surf, | |
| 88 | mesh/ordering=x varies, | |
| 89 | mesh/cols=32, | |
| 90 | mesh/rows=32, | |
| 91 | surfstyle, | |
| 92 | ] table [ | |
| 93 | x = u, | |
| 94 | z = v, | |
| 95 | y expr = 0.0, | |
| 96 | point meta = \thisrow{value}, | |
| 97 | ] {\datapath/F4.csv}; | |
| 98 | \addplot3[ | |
| 99 | surf, | |
| 100 | mesh/ordering=y varies, | |
| 101 | mesh/cols=32, | |
| 102 | mesh/rows=32, | |
| 103 | surfstyle, | |
| 104 | ] table [ | |
| 105 | x expr = 1.0, | |
| 106 | y = u, | |
| 107 | z = v, | |
| 108 | point meta = \thisrow{value}, | |
| 109 | ] {\datapath/F2.csv}; | |
| 110 | \addplot3[ | |
| 111 | surf, | |
| 112 | mesh/ordering=x varies, | |
| 113 | mesh/cols=32, | |
| 114 | mesh/rows=32, | |
| 115 | surfstyle, | |
| 116 | ] table [ | |
| 117 | x = u, | |
| 118 | y = v, | |
| 119 | z expr = 1.0, | |
| 120 | point meta = \thisrow{value}, | |
| 121 | ] {\datapath/F6.csv}; | |
| 122 | ||
| 123 | % Edges | |
| 124 | \addplot3[cube] coordinates {(0, 0, 0) (1, 0, 0) (1, 0, 1) (0, 0, 1) (0, 0, 0)}; | |
| 125 | \addplot3[cube] coordinates {(0, 0, 1) (0, 1, 1) (1, 1, 1) (1, 0, 1)}; | |
| 126 | \addplot3[cube] coordinates {(1, 0, 0) (1, 1, 0) (1, 1, 1)}; | |
| 127 | ||
| 128 | \addplot3[data,onlyfront] table[x=x,y=y,z=z] {\datapath/data.csv}; | |
| 129 | \addlegendentry{Data} | |
| 130 | ||
| 131 | \addplot3[origin,onlyfront] table[x=x,y=y,z=z] {\datapath/origin.csv}; | |
| 132 | \addlegendentry{Origin} | |
| 133 | ||
| 24 | 134 | \addplot3[iter1,onlyfront] table[x=x,y=y,z=z] {\datapath/x1_log.csv}; |
| 135 | \addlegendentry{Iterates 1} | |
| 136 | \addplot3[iter2,onlyfront] table[x=x,y=y,z=z] {\datapath/x2_log.csv}; | |
| 137 | \addlegendentry{Iterates 2} | |
| 138 | \addplot3[iter3,onlyfront] table[x=x,y=y,z=z] {\datapath/x3_log.csv}; | |
| 139 | \addlegendentry{Iterates 3} | |
| 21 | 140 | \end{axis} |
| 141 | \end{tikzpicture} | |
| 142 | ||
| 143 | \end{document} |