如何在 Tikz 中旋转文本行

如何在 Tikz 中旋转文本行
\begin{figure}[htp]
\centering
\begin{tikzpicture}[]
\begin{axis}[xtick=\empty,ytick=\empty, ztick=\empty, legend style={at={(0.95,0.50)},anchor=north east}]



     \addplot3[no marks,red] coordinates{  ( 0 , 0.0 , 1-4.99991000000000 ) ( 0 , 0.1 , 1-5.00000000000000 ) ( 0 , 0.2 , 1-4.99994000000000 ) ( 0 , 0.3 , 1-4.99993000000000 ) ( 0 , 0.4 , 1-4.99996000000000 ) ( 0 , 0.5 , 1-4.99995000000000 ) ( 0 , 0.6 , 1-4.99996000000000 ) ( 0 , 0.7 , 1-4.99997000000000 ) ( 0 , 0.8 , 1-5.00021000000000 ) ( 0 , 0.9 , 1-5.00001000000000 ) ( 0 , 1.0 , 1-5.00005000000000 ) ( 0 , 1.1 , 1-5.00000000000000 ) ( 0 , 1.2 , 1-4.99997000000000 ) ( 0 , 1.3 , 1-5.00015000000000 ) ( 0 , 1.4 , 1-4.99996000000000 ) ( 0 , 1.5 , 1-5.00000000000000 ) ( 0 , 1.6 , 1-5.00000000000000 ) ( 0 , 1.7 , 1-5.00001000000000 ) ( 0 , 1.8 , 1-5.00002000000000 ) ( 0 , 1.9 , 1-4.99996000000000 ) ( 0 , 2.0 , 1-4.99991000000000 ) ( 0 , 2.1 , 1-4.99983000000000 ) ( 0 , 2.2 , 1-4.99993000000000 ) ( 0 , 2.3 , 1-5.00004000000000 ) ( 0 , 2.4 , 1-4.99993000000000 ) ( 0 , 2.5 , 1-4.99989000000000 ) ( 0 , 2.6 , 1-4.99997000000000 ) ( 0 , 2.7 , 1-5.00007000000000 ) ( 0 , 2.8 , 1-4.99986000000000 ) ( 0 , 2.9 , 1-5.00007000000000 ) ( 0 , 3.0 , 1-4.99995000000000 ) ( 0 , 3.1 , 1-5.00005000000000 ) ( 0 , 3.2 , 1-5.00003000000000 ) ( 0 , 3.3 , 1-4.99829000000000 ) ( 0 , 3.4 , 1-5.00005000000000 ) ( 0 , 3.5 , 1-4.99994000000000 ) ( 0 , 3.6 , 1-4.99999000000000 ) ( 0 , 3.7 , 1-4.99995000000000 ) ( 0 , 3.8 , 1-5.00008000000000 ) ( 0 , 3.9 , 1-5.00005000000000 ) ( 0 , 4.0 , 1-4.99996000000000 ) ( 0 , 4.1 , 1-5.00003000000000 ) ( 0 , 4.2 , 1-5.00003000000000 ) ( 0 , 4.3 , 1-4.99999000000000 ) ( 0 , 4.4 , 1-5.00021000000000 ) ( 0 , 4.5 , 1-5.00000000000000 ) ( 0 , 4.6 , 1-5.00005000000000 ) ( 0 , 4.7 , 1-4.99998000000000 ) ( 0 , 4.8 , 1-5.00017000000000 )  };




\end{axis}  

\draw[ ] (1,-.5,0) node{Rounds 10 to 20};
    \end{tikzpicture}
\end{figure}

我怎样才能将“Rounds 10 to 20”这条线旋转 -30 度角?

答案1

只需将样式添加[rotate=-30]到您想要旋转的节点:

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xtick=\empty,ytick=\empty, ztick=\empty, legend style={at={(0.95,0.50)},anchor=north east}]
     \addplot3[no marks,red] coordinates{  ( 0 , 0.0 , 1-4.99991000000000 ) ( 0 , 0.1 , 1-5.00000000000000 ) ( 0 , 0.2 , 1-4.99994000000000 ) ( 0 , 0.3 , 1-4.99993000000000 ) ( 0 , 0.4 , 1-4.99996000000000 ) ( 0 , 0.5 , 1-4.99995000000000 ) ( 0 , 0.6 , 1-4.99996000000000 ) ( 0 , 0.7 , 1-4.99997000000000 ) ( 0 , 0.8 , 1-5.00021000000000 ) ( 0 , 0.9 , 1-5.00001000000000 ) ( 0 , 1.0 , 1-5.00005000000000 ) ( 0 , 1.1 , 1-5.00000000000000 ) ( 0 , 1.2 , 1-4.99997000000000 ) ( 0 , 1.3 , 1-5.00015000000000 ) ( 0 , 1.4 , 1-4.99996000000000 ) ( 0 , 1.5 , 1-5.00000000000000 ) ( 0 , 1.6 , 1-5.00000000000000 ) ( 0 , 1.7 , 1-5.00001000000000 ) ( 0 , 1.8 , 1-5.00002000000000 ) ( 0 , 1.9 , 1-4.99996000000000 ) ( 0 , 2.0 , 1-4.99991000000000 ) ( 0 , 2.1 , 1-4.99983000000000 ) ( 0 , 2.2 , 1-4.99993000000000 ) ( 0 , 2.3 , 1-5.00004000000000 ) ( 0 , 2.4 , 1-4.99993000000000 ) ( 0 , 2.5 , 1-4.99989000000000 ) ( 0 , 2.6 , 1-4.99997000000000 ) ( 0 , 2.7 , 1-5.00007000000000 ) ( 0 , 2.8 , 1-4.99986000000000 ) ( 0 , 2.9 , 1-5.00007000000000 ) ( 0 , 3.0 , 1-4.99995000000000 ) ( 0 , 3.1 , 1-5.00005000000000 ) ( 0 , 3.2 , 1-5.00003000000000 ) ( 0 , 3.3 , 1-4.99829000000000 ) ( 0 , 3.4 , 1-5.00005000000000 ) ( 0 , 3.5 , 1-4.99994000000000 ) ( 0 , 3.6 , 1-4.99999000000000 ) ( 0 , 3.7 , 1-4.99995000000000 ) ( 0 , 3.8 , 1-5.00008000000000 ) ( 0 , 3.9 , 1-5.00005000000000 ) ( 0 , 4.0 , 1-4.99996000000000 ) ( 0 , 4.1 , 1-5.00003000000000 ) ( 0 , 4.2 , 1-5.00003000000000 ) ( 0 , 4.3 , 1-4.99999000000000 ) ( 0 , 4.4 , 1-5.00021000000000 ) ( 0 , 4.5 , 1-5.00000000000000 ) ( 0 , 4.6 , 1-5.00005000000000 ) ( 0 , 4.7 , 1-4.99998000000000 ) ( 0 , 4.8 , 1-5.00017000000000 )  };
\end{axis}
\draw[ ] (1,-.5,0) node [rotate=-30] {Rounds 10 to 20};
\end{tikzpicture}
\end{document}

旋转节点

如果你只是想要一个倾斜的 x 轴标签,你可以简单地使用xlabel

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xtick=\empty,ytick=\empty, ztick=\empty, legend style={at={(0.95,0.50)},anchor=north east},xlabel style = {sloped},xlabel={Rounds 10 to 20}]
     \addplot3[no marks,red] coordinates{  ( 0 , 0.0 , 1-4.99991000000000 ) ( 0 , 0.1 , 1-5.00000000000000 ) ( 0 , 0.2 , 1-4.99994000000000 ) ( 0 , 0.3 , 1-4.99993000000000 ) ( 0 , 0.4 , 1-4.99996000000000 ) ( 0 , 0.5 , 1-4.99995000000000 ) ( 0 , 0.6 , 1-4.99996000000000 ) ( 0 , 0.7 , 1-4.99997000000000 ) ( 0 , 0.8 , 1-5.00021000000000 ) ( 0 , 0.9 , 1-5.00001000000000 ) ( 0 , 1.0 , 1-5.00005000000000 ) ( 0 , 1.1 , 1-5.00000000000000 ) ( 0 , 1.2 , 1-4.99997000000000 ) ( 0 , 1.3 , 1-5.00015000000000 ) ( 0 , 1.4 , 1-4.99996000000000 ) ( 0 , 1.5 , 1-5.00000000000000 ) ( 0 , 1.6 , 1-5.00000000000000 ) ( 0 , 1.7 , 1-5.00001000000000 ) ( 0 , 1.8 , 1-5.00002000000000 ) ( 0 , 1.9 , 1-4.99996000000000 ) ( 0 , 2.0 , 1-4.99991000000000 ) ( 0 , 2.1 , 1-4.99983000000000 ) ( 0 , 2.2 , 1-4.99993000000000 ) ( 0 , 2.3 , 1-5.00004000000000 ) ( 0 , 2.4 , 1-4.99993000000000 ) ( 0 , 2.5 , 1-4.99989000000000 ) ( 0 , 2.6 , 1-4.99997000000000 ) ( 0 , 2.7 , 1-5.00007000000000 ) ( 0 , 2.8 , 1-4.99986000000000 ) ( 0 , 2.9 , 1-5.00007000000000 ) ( 0 , 3.0 , 1-4.99995000000000 ) ( 0 , 3.1 , 1-5.00005000000000 ) ( 0 , 3.2 , 1-5.00003000000000 ) ( 0 , 3.3 , 1-4.99829000000000 ) ( 0 , 3.4 , 1-5.00005000000000 ) ( 0 , 3.5 , 1-4.99994000000000 ) ( 0 , 3.6 , 1-4.99999000000000 ) ( 0 , 3.7 , 1-4.99995000000000 ) ( 0 , 3.8 , 1-5.00008000000000 ) ( 0 , 3.9 , 1-5.00005000000000 ) ( 0 , 4.0 , 1-4.99996000000000 ) ( 0 , 4.1 , 1-5.00003000000000 ) ( 0 , 4.2 , 1-5.00003000000000 ) ( 0 , 4.3 , 1-4.99999000000000 ) ( 0 , 4.4 , 1-5.00021000000000 ) ( 0 , 4.5 , 1-5.00000000000000 ) ( 0 , 4.6 , 1-5.00005000000000 ) ( 0 , 4.7 , 1-4.99998000000000 ) ( 0 , 4.8 , 1-5.00017000000000 )  };
\end{axis}
\end{tikzpicture}
\end{document}

斜面标签

相关内容