Code Monkey home page Code Monkey logo

matlab2tikz's Introduction

=============================== Logo contest!

On http://tex.stackexchange.com/questions/132985/matlab2tikz-logo you can submit your own suggestion for a new matlab2tikz logo. Chime in if you have something nice and iconic in mind!

===============================

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.

  1. 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).
  2. Generate your plot in MATLAB.

  3. 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.

  1. 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:

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.

matlab2tikz's People

Contributors

nschloe avatar egeerardyn avatar blubbafett avatar magicmuscleman avatar aliirmak avatar gontadu avatar mkiefel avatar mbauman avatar josombio avatar

Watchers

 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.