3

Just wonder if this could be done with tikz? I know I should provide at least a MWE, but I am new to latex and have absolutely no idea where to start.

enter image description here

MWE (Addition by HK)

\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{positioning,shadows}
\tikzset{
  %% fill styles if needed
}

\begin{document}
  \begin{tikzpicture}
    \node (a) at (0,0)  {a};
  \end{tikzpicture}
\end{document}
  • This can certainly be done by hand (meaning defining all the lines explicitly, etc.) with a lot of work. There are ways of doing bar charts with pgfplots. You might be able to build up from there. See this example: tex.stackexchange.com/questions/185136/… – Miguel Aug 28 '14 at 6:55
  • 3
    It's a pretty useless plot, since you cannot easily compare the different values. – Alex Aug 29 '14 at 17:15
1

Here's a rough approximation...I didn't try to replicate the numbers in the MWE and haven't finetuned the details.

enter image description here

Here's the code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{3d}
\usetikzlibrary{calc}
\usetikzlibrary{patterns}
\begin{document}

% \Yvalue{x-coordinate}{y-coordinate}{colour}
\newcommand\drawYvalue[3]{%
  \draw[fill=#3!30](#1,0,1)--++(-1,0,0)--++(0,#2,0)--++(1,0,0)--cycle;
  \draw[fill=#3!10](#1,#2,1)--++(-1,0,0)--++(0,0,-1)--++(1,0,0)--cycle;
  \draw[fill=#3!15](#1,0,1)--++(0,0,-1)--++(0,#2,0)--++(0,0,1)--cycle;
 }

\begin{tikzpicture}
  \foreach \x in {0,4,8} {
    \draw[pattern=north east lines, pattern color=blue!10]
           (\x,0,0)--++(2,0,0)--++(0,6,0)--++(-2,0,0)--cycle;
  }
  \foreach \x in {0,2,4,6} {
    \draw[blue!50](\x,0,2)--++(0,0,-2)--++(0,6,0);
  }
  \draw[blue!50](0,0,2)--++(0,6,0);
  \foreach \y in {0,2,4,6} {
    \draw[blue!50](10,\y,0)--++(-10,0,0)--++(0,0,2);
  }
  \foreach \y/\txt [count=\x]
    in {3/Label 1, 4/Label 2, 1/Label 3, 5/Label 4,6/Label 5} {
    \drawYvalue{2*\x-0.5}{\y}{\ifodd\x yellow\else green\fi}
    \begin{scope}[canvas is zx plane at y=0]
      \node[transform shape,rotate=180] at (3,2*\x-1)[anchor=west,align=right]{\txt};
    \end{scope}
  }
\end{tikzpicture}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.