# sloped text along slanted paths in TikZ

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}


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

• 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. Oct 29, 2013 at 14:59
• Excuse the pun but y slant? Oct 29, 2013 at 15:02
• I have a complex figure similar to this: tex.stackexchange.com/questions/12689/… Can I do this using rotation? Oct 29, 2013 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. Oct 30, 2013 at 12:36
• Then again, if you want 3d text, you need xslant. Nov 2, 2013 at 15:35

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}


• I don't just need the axes, the code I posted was just an MWE. I've updated my question. Nov 1, 2013 at 16:23
• I have better luck with xslant than yslant Nov 1, 2013 at 23:41

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}


• You really like pstricks :D Tell me, are the direction of the axis manually set? I see numbers in your code. :P Oct 30, 2013 at 21:50
• @Alenanno: Yes. It was manually set up because I was not using the 3D package. Oct 30, 2013 at 21:53
• sorry, i'm really looking for a TikZ solution Nov 1, 2013 at 16:22