倾斜范围内的路径上的倾斜文本节点似乎偏离了方向。有什么方法可以解决这个问题吗?
\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}
编辑:我不只是需要轴,这里是整个图形:
答案1
这就是你要去的地方吗?
\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}
答案2
使用 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}