pgfplots 中的旋转曲面

pgfplots 中的旋转曲面

我想为正在编写的一份乳胶报告绘制一个图。实际上,该图是一个位于圆顶上的抛物面,但我在为抛物面创建旋转表面时遇到了一些问题。

我尝试遵循 cmhughes 在旋转曲面但会出现编译错误,要么是未指定的“以退出代码 1 完成”要么是“算术溢出 \end{axis}”,具体取决于我使用的示例。

麦克风

例子;

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
 \begin{axis}[view={60}{30}]
  \addplot3[surf,shader=flat,
  samples=20,
  domain=1:2,y domain=0:2*pi,
  z buffer=sort]
  (x,{(1/x) * cos(deg(y))}, {(1/x) * sin(deg(y))});
 \end{axis}
\end{tikzpicture}
\end{document}

给出错误“已完成,退出代码为 1”。日志文件给出了一些我不太明白的消息;

! Package pgfplots Warning: Axis range for axis x is approximately     equal; enlargeing it.

! Package pgfkeys Error: I do not know the key '/tikz/surf' and I am going to ignore it. Perhaps you misspelled it.

This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.


! Package pgfkeys Error: I do not know the key '/tikz/shader' and I am   going to ignore it. Perhaps you misspelled it.

还有其他几个人也有同样的想法:“我不知道 /tikz/X 是什么”。使用 /listfiles 查找版本,输出为;

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
inputenc.sty    2008/03/30 v1.1d Input encoding file
    utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc
   t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
pgfplots.sty    2009/02/14 Version 1.2.2
    tikz.sty    2010/10/13 v2.10 (rcs-revision 1.76)
     pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2009/08/28 v1.8 graphics configuration of TeX Live
  pdftex.def    2010/03/12 v0.04p Graphics/color for pdfTeX
  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
 xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)
  pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)
 pgfkeys.sty    
 pgfkeys.code.tex
  pgffor.code.tex
    tikz.code.tex
supp-pdf.mkii
 ***********

上述问题源于过时的 pgf 和 pgfplots,现已得到纠正。

答案1

您的版本pgfplots已过时(正如@Jake 所建议的)。

请升级两个都 pgfplotspgf更新至最新版本并重试。

相关内容