pst-solides3d 绘图顶部的图例

pst-solides3d 绘图顶部的图例

关于可见性的另一个问题pst-solides3d

如何在 3D 图纸上绘制图例?

我认为将put命令放在 3d 绘图命令之前或之后会将文本呈现在前台,但无论哪种方式,文本都会被隐藏:

\documentclass[10pt]{article}

\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{pst-solides3d}


\begin{document}

\begin{figure}[h!]
\centering
\begin{pspicture}(0,-3)(7,3)

\psset{viewpoint=60 30 30 rtp2xyz,Decran=60,lightsrc=viewpoint, solidmemory}

\Large
\rput(0.5,2.7){$x^2$}
\normalsize

\psSolid[object=cylindre, h=0.4,r=2.7, fillcolor=white, ngrid=1 32, RotY=0, RotX=0] (0,0,1.1445)

\Large
\rput(0,2.7){$x^2$}
\normalsize

\end{pspicture}
\end{figure}

\end{document}

汇编:latex bug.tex; dvips bug.dvi; ps2pdf bug.ps

答案1

简单的方法是包含pst-3dplot包,然后使用\pstThreeDPut命令。

\documentclass[10pt]{article}

\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{pst-solides3d}
\usepackage{pst-3dplot}

\begin{document}

\begin{figure}[h!]
\centering
\begin{pspicture}(0,-3)(7,3)

\psset{viewpoint=60 30 30 rtp2xyz,Decran=60,lightsrc=viewpoint, solidmemory}

\psSolid[object=cylindre, h=0.4,r=2.7, fillcolor=white, ngrid=1 32, RotY=0, RotX=0]     (0,0,1.1445)

\Large
\pstThreeDPut(0,2.7,2.5){$x^2$}

\end{pspicture}
\end{figure}

\end{document}

相关内容