您的位置:首页 > 其它

Tex系列: pgfplots安装

2016-06-15 20:59 387 查看
(1) 上网下载最新宏包压缩包

http://sourceforge.net/projects/pgfplots/files/pgfplots/

(2)解压压缩包,把该包下的tex子目录拷贝至D:\texmf\ 下,全部覆盖即可。

(3)重建TeX文件名数据库,执行DOS命令: texhash --admin

用pdflatex编译文档的过程中,可能由于绘图数据过多导致内存使用超出TeX内存大小上限,从而编译失败,解决办法就是指定更大的内存空间,步骤如下:

1. 打开DOS命令窗口

2. 在DOS命令窗口中输入

initexmf --edit-config-file=pdflatex

3. 在自动打开的编辑器中输入

main_memory=20000000

然后存盘文件, 关掉编辑器.

4. 在DOS命令行, 输入

initexmf --dump=pdflatex

注: 同样的办法也适用于latex.

比如编译下面的文档:

[cpp] view plain copy

\documentclass[a4paper]{article}

\usepackage{pgfplots}

\usepgfplotslibrary{colormaps}

\pgfplotsset{compat=newest}

\usepackage[graphics,tightpage,active]{preview}

\setlength{\PreviewBorder}{5pt} \PreviewEnvironment{tikzpicture}

\begin{document}

\begin{tikzpicture}

\begin{axis}[title=$120 \times 120$ Smooth Surface, xlabel=$x$, ylabel=$y$]

\addplot3[surf,samples=120,shader=interp,domain=0:1] {

sin(deg(8*pi*x))* exp(-20*(y-0.5)^2) + exp(-(x-0.5)^2*30-

(y-0.25)^2 - (x-0.5)*(y-0.25))

};

\end{axis}

\end{tikzpicture}

\end{document}

如果TeX内存上限太小,就会导致编译失败。按上述设置可编译通过。结果如下:



from: http://blog.csdn.net/mathsoperator/article/details/6819561
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: