matlab tikz,[zz]matlab2tikz/matlab2tikz介绍

This is matlab2tikz, a MATLAB(R) script for converting MATLAB

figures into native TikZ/Pgfplots figures.

matlab2tikz supports the conversion of most MATLAB figures,

including 2D and 3D plots. For plots constructed with third- party

packages, your mileage may vary.

The workflow is as follows.

a. Place the matlab2tikz scripts (contents of src/ folder) in a

directory where MATLAB can find it (the current directory, for

example). b. Make sure that your LaTeX installation includes the

packages

TikZ (aka PGF, >=2.00) and

Pgfplots (>=1.3).

Generate your plot in MATLAB.

Invoke matlab2tikz by

```

>> matlab2tikz();

```

or

```

>> matlab2tikz('myfile.tex');

```

The script accepts numerous options; check them out by invoking the

help,

```

>> help matlab2tikz

```

Sometimes, MATLAB makes it hard to create matching LaTeX plots by

keeping invisible objects around or stretches the plots too far

beyond the bounding box. Use

```

>> cleanfigure;

>> matlab2tikz('myfile.tex');

```

to first clean the figure of unwanted entities, and then convert it

to TeX.

Add the contents of `myfile.tex` into your LaTeX source code; a

convenient way of doing so is to use `\input{/path/to/myfile.tex}`.

Also make sure that at the header of your document the Pgfplots

package is included:

```

\documentclass{article}

\usepackage{pgfplots}

% and optionally (as of Pgfplots 1.3):

\pgfplotsset{compat=newest}

\pgfplotsset{plot coordinates/math parser=false}

\newlength\figureheight

\newlength\figurewidth

\begin{document}

\input{myfile.tex}

\end{document}

```

There are reported incompatibilities with the following LaTeX

packages:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值