1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
|
\documentclass[class=minimal,border=0pt,convert={density=300,outext=.png}]{standalone}
% \documentclass[class=minimal,border=0pt]{standalone}
\usepackage[scaled]{helvet}
\renewcommand*\familydefault{\sfdefault}
% ===========================================================================
% The code below (used to define the \tikzcuboid command) is copied,
% unmodified, from a tex.stackexchange.com answer by the user "Tom Bombadil":
% http://tex.stackexchange.com/a/29882/8335
%
% It is licensed under the Creative Commons Attribution-ShareAlike 3.0
% Unported license: http://creativecommons.org/licenses/by-sa/3.0/
% ===========================================================================
\usepackage[usenames,dvipsnames]{color}
\usepackage{tikz}
\usepackage{keyval}
\usepackage{ifthen}
%====================================
%emphasize vertices --> switch and emph style (e.g. thick,black)
%====================================
\makeatletter
% Standard Values for Parameters
\newcommand{\tikzcuboid@shiftx}{0}
\newcommand{\tikzcuboid@shifty}{0}
\newcommand{\tikzcuboid@dimx}{3}
\newcommand{\tikzcuboid@dimy}{3}
\newcommand{\tikzcuboid@dimz}{3}
\newcommand{\tikzcuboid@scale}{1}
\newcommand{\tikzcuboid@densityx}{1}
\newcommand{\tikzcuboid@densityy}{1}
\newcommand{\tikzcuboid@densityz}{1}
\newcommand{\tikzcuboid@rotation}{0}
\newcommand{\tikzcuboid@anglex}{0}
\newcommand{\tikzcuboid@angley}{90}
\newcommand{\tikzcuboid@anglez}{225}
\newcommand{\tikzcuboid@scalex}{1}
\newcommand{\tikzcuboid@scaley}{1}
\newcommand{\tikzcuboid@scalez}{sqrt(0.5)}
\newcommand{\tikzcuboid@linefront}{black}
\newcommand{\tikzcuboid@linetop}{black}
\newcommand{\tikzcuboid@lineright}{black}
\newcommand{\tikzcuboid@fillfront}{white}
\newcommand{\tikzcuboid@filltop}{white}
\newcommand{\tikzcuboid@fillright}{white}
\newcommand{\tikzcuboid@shaded}{N}
\newcommand{\tikzcuboid@shadecolor}{black}
\newcommand{\tikzcuboid@shadeperc}{25}
\newcommand{\tikzcuboid@emphedge}{N}
\newcommand{\tikzcuboid@emphstyle}{thick}
% Definition of Keys
\define@key{tikzcuboid}{shiftx}[\tikzcuboid@shiftx]{\renewcommand{\tikzcuboid@shiftx}{#1}}
\define@key{tikzcuboid}{shifty}[\tikzcuboid@shifty]{\renewcommand{\tikzcuboid@shifty}{#1}}
\define@key{tikzcuboid}{dimx}[\tikzcuboid@dimx]{\renewcommand{\tikzcuboid@dimx}{#1}}
\define@key{tikzcuboid}{dimy}[\tikzcuboid@dimy]{\renewcommand{\tikzcuboid@dimy}{#1}}
\define@key{tikzcuboid}{dimz}[\tikzcuboid@dimz]{\renewcommand{\tikzcuboid@dimz}{#1}}
\define@key{tikzcuboid}{scale}[\tikzcuboid@scale]{\renewcommand{\tikzcuboid@scale}{#1}}
\define@key{tikzcuboid}{densityx}[\tikzcuboid@densityx]{\renewcommand{\tikzcuboid@densityx}{#1}}
\define@key{tikzcuboid}{densityy}[\tikzcuboid@densityy]{\renewcommand{\tikzcuboid@densityy}{#1}}
\define@key{tikzcuboid}{densityz}[\tikzcuboid@densityz]{\renewcommand{\tikzcuboid@densityz}{#1}}
\define@key{tikzcuboid}{rotation}[\tikzcuboid@rotation]{\renewcommand{\tikzcuboid@rotation}{#1}}
\define@key{tikzcuboid}{anglex}[\tikzcuboid@anglex]{\renewcommand{\tikzcuboid@anglex}{#1}}
\define@key{tikzcuboid}{angley}[\tikzcuboid@angley]{\renewcommand{\tikzcuboid@angley}{#1}}
\define@key{tikzcuboid}{anglez}[\tikzcuboid@anglez]{\renewcommand{\tikzcuboid@anglez}{#1}}
\define@key{tikzcuboid}{scalex}[\tikzcuboid@scalex]{\renewcommand{\tikzcuboid@scalex}{#1}}
\define@key{tikzcuboid}{scaley}[\tikzcuboid@scaley]{\renewcommand{\tikzcuboid@scaley}{#1}}
\define@key{tikzcuboid}{scalez}[\tikzcuboid@scalez]{\renewcommand{\tikzcuboid@scalez}{#1}}
\define@key{tikzcuboid}{linefront}[\tikzcuboid@linefront]{\renewcommand{\tikzcuboid@linefront}{#1}}
\define@key{tikzcuboid}{linetop}[\tikzcuboid@linetop]{\renewcommand{\tikzcuboid@linetop}{#1}}
\define@key{tikzcuboid}{lineright}[\tikzcuboid@lineright]{\renewcommand{\tikzcuboid@lineright}{#1}}
\define@key{tikzcuboid}{fillfront}[\tikzcuboid@fillfront]{\renewcommand{\tikzcuboid@fillfront}{#1}}
\define@key{tikzcuboid}{filltop}[\tikzcuboid@filltop]{\renewcommand{\tikzcuboid@filltop}{#1}}
\define@key{tikzcuboid}{fillright}[\tikzcuboid@fillright]{\renewcommand{\tikzcuboid@fillright}{#1}}
\define@key{tikzcuboid}{shaded}[\tikzcuboid@shaded]{\renewcommand{\tikzcuboid@shaded}{#1}}
\define@key{tikzcuboid}{shadecolor}[\tikzcuboid@shadecolor]{\renewcommand{\tikzcuboid@shadecolor}{#1}}
\define@key{tikzcuboid}{shadeperc}[\tikzcuboid@shadeperc]{\renewcommand{\tikzcuboid@shadeperc}{#1}}
\define@key{tikzcuboid}{emphedge}[\tikzcuboid@emphedge]{\renewcommand{\tikzcuboid@emphedge}{#1}}
\define@key{tikzcuboid}{emphstyle}[\tikzcuboid@emphstyle]{\renewcommand{\tikzcuboid@emphstyle}{#1}}
% Commands
\newcommand{\tikzcuboid}[1]{
\setkeys{tikzcuboid}{#1} % Process Keys passed to command
\pgfmathsetmacro{\vectorxx}{\tikzcuboid@scalex*cos(\tikzcuboid@anglex)}
\pgfmathsetmacro{\vectorxy}{\tikzcuboid@scalex*sin(\tikzcuboid@anglex)}
\pgfmathsetmacro{\vectoryx}{\tikzcuboid@scaley*cos(\tikzcuboid@angley)}
\pgfmathsetmacro{\vectoryy}{\tikzcuboid@scaley*sin(\tikzcuboid@angley)}
\pgfmathsetmacro{\vectorzx}{\tikzcuboid@scalez*cos(\tikzcuboid@anglez)}
\pgfmathsetmacro{\vectorzy}{\tikzcuboid@scalez*sin(\tikzcuboid@anglez)}
\begin{scope}[xshift=\tikzcuboid@shiftx, yshift=\tikzcuboid@shifty, scale=\tikzcuboid@scale, rotate=\tikzcuboid@rotation, x={(\vectorxx,\vectorxy)}, y={(\vectoryx,\vectoryy)}, z={(\vectorzx,\vectorzy)}]
\pgfmathsetmacro{\steppingx}{1/\tikzcuboid@densityx}
\pgfmathsetmacro{\steppingy}{1/\tikzcuboid@densityy}
\pgfmathsetmacro{\steppingz}{1/\tikzcuboid@densityz}
\newcommand{\dimx}{\tikzcuboid@dimx}
\newcommand{\dimy}{\tikzcuboid@dimy}
\newcommand{\dimz}{\tikzcuboid@dimz}
\pgfmathsetmacro{\secondx}{2*\steppingx}
\pgfmathsetmacro{\secondy}{2*\steppingy}
\pgfmathsetmacro{\secondz}{2*\steppingz}
\foreach \x in {\steppingx,\secondx,...,\dimx}
{ \foreach \y in {\steppingy,\secondy,...,\dimy}
{ \pgfmathsetmacro{\lowx}{(\x-\steppingx)}
\pgfmathsetmacro{\lowy}{(\y-\steppingy)}
\filldraw[fill=\tikzcuboid@fillfront,draw=\tikzcuboid@linefront] (\lowx,\lowy,\dimz) -- (\lowx,\y,\dimz) -- (\x,\y,\dimz) -- (\x,\lowy,\dimz) -- cycle;
}
}
\foreach \x in {\steppingx,\secondx,...,\dimx}
{ \foreach \z in {\steppingz,\secondz,...,\dimz}
{ \pgfmathsetmacro{\lowx}{(\x-\steppingx)}
\pgfmathsetmacro{\lowz}{(\z-\steppingz)}
\filldraw[fill=\tikzcuboid@filltop,draw=\tikzcuboid@linetop] (\lowx,\dimy,\lowz) -- (\lowx,\dimy,\z) -- (\x,\dimy,\z) -- (\x,\dimy,\lowz) -- cycle;
}
}
\foreach \y in {\steppingy,\secondy,...,\dimy}
{ \foreach \z in {\steppingz,\secondz,...,\dimz}
{ \pgfmathsetmacro{\lowy}{(\y-\steppingy)}
\pgfmathsetmacro{\lowz}{(\z-\steppingz)}
\filldraw[fill=\tikzcuboid@fillright,draw=\tikzcuboid@lineright] (\dimx,\lowy,\lowz) -- (\dimx,\lowy,\z) -- (\dimx,\y,\z) -- (\dimx,\y,\lowz) -- cycle;
}
}
\ifthenelse{\equal{\tikzcuboid@emphedge}{Y}}%
{\draw[\tikzcuboid@emphstyle](0,\dimy,0) -- (\dimx,\dimy,0) -- (\dimx,\dimy,\dimz) -- (0,\dimy,\dimz) -- cycle;%
\draw[\tikzcuboid@emphstyle] (0,0,\dimz) -- (0,\dimy,\dimz) -- (\dimx,\dimy,\dimz) -- (\dimx,0,\dimz) -- cycle;%
\draw[\tikzcuboid@emphstyle](\dimx,0,0) -- (\dimx,\dimy,0) -- (\dimx,\dimy,\dimz) -- (\dimx,0,\dimz) -- cycle;%
}%
{}
\end{scope}
}
\makeatother
\begin{document}
\begin{tikzpicture}
\tikzcuboid{%
shiftx=16cm,%
shifty=8cm,%
scale=1.00,%
rotation=0,%
densityx=2,%
densityy=2,%
densityz=2,%
dimx=4,%
dimy=3,%
dimz=3,%
linefront=teal!75!black,%
linetop=teal!50!black,%
lineright=teal!25!black,%
fillfront=teal!25!white,%
filltop=teal!50!white,%
fillright=teal!75!white,%
emphedge=Y,%
emphstyle=very thick,
}
\tikzcuboid{%
shiftx=21cm,%
shifty=8cm,%
scale=1.00,%
rotation=0,%
densityx=2,%
densityy=2,%
densityz=2,%
dimx=4,%
dimy=3,%
dimz=3,%
linefront=purple!75!black,%
linetop=purple!50!black,%
lineright=purple!25!black,%
fillfront=purple!25!white,%
filltop=purple!50!white,%
fillright=purple!75!white,%
emphedge=Y,%
emphstyle=very thick,
}
\tikzcuboid{%
shiftx=26.2cm,%
shifty=8cm,%
scale=1.00,%
rotation=0,%
densityx=10000,%
densityy=2,%
densityz=2,%
dimx=0,%
dimy=3,%
dimz=3,%
linefront=orange!75!black,%
linetop=orange!50!black,%
lineright=orange!25!black,%
fillfront=orange!25!white,%
filltop=orange!50!white,%
fillright=orange!100!white,%
emphedge=Y,%
emphstyle=very thick,
}
\tikzcuboid{%
shiftx=27.6cm,%
shifty=8cm,%
scale=1.00,%
rotation=0,%
densityx=10000,%
densityy=2,%
densityz=2,%
dimx=0,%
dimy=3,%
dimz=3,%
linefront=purple!75!black,%
linetop=purple!50!black,%
lineright=purple!25!black,%
fillfront=purple!25!white,%
filltop=purple!50!white,%
fillright=red!75!white,%
emphedge=Y,%
emphstyle=very thick,
}
\tikzcuboid{%
shiftx=28cm,%
shifty=6.5cm,%
scale=1.00,%
rotation=0,%
densityx=2,%
densityx=2,%
densityy=100,%
densityz=100,%
dimx=4,%
dimy=0,%
dimz=0,%
emphedge=Y,%
emphstyle=very thick,
}
\tikzcuboid{%
shiftx=28cm,%
shifty=6.5cm,%
scale=1.00,%
rotation=0,%
densityx=100,%
densityy=2,%
densityz=100,%
dimx=0,%
dimy=3,%
dimz=0,%
emphedge=Y,%
emphstyle=very thick,
}
\tikzcuboid{%
shiftx=28cm,%
shifty=6.5cm,%
scale=1.00,%
rotation=180,%
densityx=100,%
densityy=100,%
densityz=2,%
dimx=0,%
dimy=0,%
dimz=3,%
emphedge=Y,%
emphstyle=very thick,
}
\node [font=\fontsize{11}{11}\selectfont] at (18,11.5) {temperature};
\node [font=\fontsize{11}{11}\selectfont] at (23,11.5) {precipitation};
\node [font=\fontsize{11}{11}\selectfont] at (25.8,11.5) {latitude};
\node [font=\fontsize{11}{11}\selectfont] at (27.5,11.47) {longitude};
\node [font=\fontsize{11}{11}\selectfont] at (28,10) {x};
\node [font=\fontsize{11}{11}\selectfont] at (29.5,8.5) {y};
\node [font=\fontsize{11}{11}\selectfont] at (32,7) {t};
\node [font=\fontsize{11}{11}\selectfont] at (31,10) {reference\_time};
\fill (31,9.5) circle[radius=2pt];
\end{tikzpicture}
\end{document}
|