Giter VIP home page Giter VIP logo

matlab2tikz's Introduction

This is matlab2tikz, a MATLAB(R) script for converting MATLAB(R) figures into native
TikZ figures.

To download and rate matlab2tikz, go to its page on MathWorks 
http://www.mathworks.com/matlabcentral/fileexchange/22022.

As of now, matlab2tikz does by far not support the conversion of all possible
MATLAB figures. In particular, 3D plots are not yet supported. However, the if
you have a nice 2D plot, matlab2tikz might just do what you want it to.

The plots that matlab2tikz handles properly are, but are not limited to

  * most axes properties (including logarithmic scaling),
  * grids,
  * line plots (including markers line styles),
  * error bars,
  * contour(f) plots,
  * bar plots (stacked, grouped, histgrams),
  * stem plots,
  * stairs plots,
  * quiver (arrow) plots,
  * colorbars,
  * legends,
  * images,
  * (rose plots),
  * (compass plots),
  * (polar plots),
  * subplots,
  * zplane plots,
  * frequency response plots,
  * scatter plots,
  * surf plots.


The workflow is as follows.

  0.) a) Place the matlab2tikz script 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( 'myfile.tikz' );

      Optional:
      The scripts accepts several options, 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\figurewith
        \setlength\figureheight{4cm}
	\setlength\figurewidth{6cm}
	\input{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}

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 http://github.com/nicki/matlab2tikz.

There's also a matlab2tikz forum at http://win.ua.ac.be/~nschloe/forum/12/.

matlab2tikz's People

Contributors

magicmuscleman avatar mbauman avatar nschloe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.