forked from matlab2tikz/matlab2tikz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
73 lines (46 loc) · 2.28 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
This is matlab2tikz, a MATLAB(R) script for converting MATLAB(R) figures into native
TikZ/pgfplots figures.
To download and rate matlab2tikz, go to its page on MathWorks
http://www.mathworks.com/matlabcentral/fileexchange/22022.
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.
0.) 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).
1.) Generate your plot in MATLAB.
2.) Invoke matlab2tikz by
>> matlab2tikz();
or
>> matlab2tikz( 'myfile.tikz' );
3.) Add the contents of myfile.tikz into your LaTeX source code; a
convenient way of doing so is to use \input{/path/to/myfile.tikz}.
Also make sure that at the header of your document the packages tikz and
pgfplots are included:
\usepackage{pgfplots}
and optionally (as of Pgfplots 1.3)
\pgfplotsset{compat=newest}
\pgfplotsset{plot coordinates/math parser=false}
Note:
The script accepts several options; check them out by invoking the help,
>> help matlab2tikz
for example 'height', 'width', 'encoding', and some more. Invoke by
>> matlab2tikz( 'myfile.tikz', 'height', '4cm', 'width', '3in' );
To specify the dimension of the plot from within the LaTeX document, try
>> matlab2tikz( 'myfile.tikz', 'height', '\figureheight', 'width', '\figurewidth' );
and in the LaTeX source
\newlength\figureheight
\newlength\figurewidth
\setlength\figureheight{4cm}
\setlength\figurewidth{6cm}
\input{myfile.tikz}
There are reported incompatibilties with the follwing LaTeX packages:
* signalflowdiagram <http://www.texample.net/tikz/examples/signal-flow-building-blocks/>
If you experience bugs, have nice examples of what matlab2tikz can do, or if
you are just looking for more information, please visit the web page of
matlab2tikz <https://github.com/nschloe/matlab2tikz>.
There's also a matlab2tikz forum at http://win.ua.ac.be/~nschloe/forum/12/.