4

How do I draw a Permutahedron of order 3 in tikz in 3 dimensions? I'd like to get a readable code which draws a planar projection of a 3D object rather than unreadable (hence unmaintainbale) automatically generated output. This is slightly more complicated than Drawing polyhedra using TikZ with semi-transparent and shading effect as we wish to color-fill a nontriangular, nonrectangular 2D object embedded into a 3D object.

As of today, sagetex in not available on the distributions I am using, so I am wishing to do without it.

  • SagemathCloud offers free accounts that have sagetex and other features built in. – DJP Jul 27 '16 at 18:42
6

You could use PGFPlots for this:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    view={110}{30},
    xmin=1, xmax=3,
    ymin=1, ymax=3,
    zmin=1, zmax=3,
    axis equal image
]
\addplot3 [fill=cyan, fill opacity=0.5] table {
x y z
1 2 3
2 1 3
3 1 2
3 2 1
2 3 1
1 3 2
}--cycle;
\end{axis}
\end{tikzpicture}

\end{document}
  • @LeonMeier: Thanks, I edited the MWE to include the compat setting. It doesn't change anything about the output in this case, but it's good practice anyway. – Jake Jul 27 '16 at 21:18

Your Answer

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