17

Sloped text nodes along paths in a slanted scope seem off. Is there any way to fix this?

\documentclass{standalone}

\usepackage{tikz}
\newcommand{\yslant}{0.5}
\newcommand{\xslant}{-0.6}

\begin{document}
\begin{tikzpicture}[scale=2]
    \begin{scope}[every node/.append style={yslant=\yslant,xslant=\xslant}, yslant=\yslant,xslant=\xslant]
        \draw (-0.5,5) -- (-0.5,2) node [midway, below, sloped] {weaker control flow};
        \draw (-0.5,5) -- (2,5) node [midway, above, sloped] {well-formedness};
        \draw (-0.5,5) -- (-2,2.5) node [midway, above, sloped] {number of exits};
    \end{scope}
\end{tikzpicture}
\end{document}

enter image description here

Edit: I don't just need the axes, here's the whole figure:

enter image description here

thpani
  • 493
  • My advice is to use rotate instead of slanting. From what I can tell, the effect of slanting is x'=x(y) + xslanty and y'= y(x) + yslantx, so the results depend on which slant is performed first. – John Kormylo Oct 29 '13 at 14:59
  • 1
    Excuse the pun but y slant? – percusse Oct 29 '13 at 15:02
  • I have a complex figure similar to this: http://tex.stackexchange.com/questions/12689/visualize-connection-between-two-slanted-tikz-scopes Can I do this using rotation? – thpani Oct 29 '13 at 20:32
  • The advantage of slant in the mentioned example is that it turns a rectangle into a parallelogram. You could just draw a parallelogram, in which case you wouldn't need either slant or rotate. – John Kormylo Oct 30 '13 at 12:36
  • Then again, if you want 3d text, you need xslant. – John Kormylo Nov 02 '13 at 15:35

2 Answers2

11

Is this sort of where you are headed?

\documentclass{standalone}
\usepackage{tikz}

\pgfsetxvec{\pgfpoint{.866cm}{.5cm}}
\pgfsetyvec{\pgfpoint{.866cm}{-.5cm}}
\pgfsetzvec{\pgfpoint{0cm}{-1cm}}

\begin{document}

\begin{tikzpicture}
\draw [->] (0,0,0) -- (5,0,0) node[midway,sloped,above,xslant=-0.5] {well-formedness};
\draw [->] (0,0,0) -- (0,5,0) node[midway,sloped,above,xslant=0.5] {weaker control flow};
\draw [<-] (0,0,5) -- (0,0,0) node[midway,sloped,above] {number of exits};
\path (2,1,0) node[rectangle,draw=black,rotate=30,xslant=-0.5] {test};
\end{tikzpicture}

\end{document}

new trial

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
2

With PSTricks.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-node}
\psset{nrot=:U,shortput=nab}
\begin{document}
\begin{pspicture}(6,6)
    \pcline{->}(2,2)(2,6)^{$y$-axis}
    \pcline{<-}(0,0)(2,2)^{$z$-axis}
    \pcline{->}(2,2)(6,2)^{$x$-axis}
\end{pspicture}
\end{document}

enter image description here