• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

matlab2tikz/matlab2tikz: This program converts MATLAB®/Octave figures to TikZ/p ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

matlab2tikz/matlab2tikz

开源软件地址(OpenSource Url):

https://github.com/matlab2tikz/matlab2tikz

开源编程语言(OpenSource Language):

MATLAB 99.4%

开源软件介绍(OpenSource Introduction):

The updater in matlab2tikz 0.6.0 (and older) no longer works. Please update manually if you are not using matlab2tikz 1.0.0 or newer!

Build Status DOI matlab2tikz

matlab2tikz is a MATLAB(R) script to convert native MATLAB(R) figures to TikZ/Pgfplots figures that integrate seamlessly in LaTeX documents.

To download the official releases and rate matlab2tikz, please visit its page on FileExchange.

matlab2tikz converts most MATLAB(R) figures, including 2D and 3D plots. For plots constructed with third-party packages, however, your mileage may vary.

Installation

  1. Extract the ZIP file (or clone the git repository) somewhere you can easily reach it.
  2. Add the src/ folder to your path in MATLAB/Octave: e.g.
    • using the "Set Path" dialog in MATLAB, or
    • by running the addpath function from your command window or startup script.

Make sure that your LaTeX installation is up-to-date and includes:

It is recommended to use the latest stable version of these packages. Older versions may work depending on the actual MATLAB(R) figure you are converting.

Usage

Typical usage of matlab2tikz consists of converting your MATLAB plot to a TikZ/LaTeX file and then running a LaTeX compiler to produce your document.

MATLAB

  1. Generate your plot in MATLAB(R).

  2. Run matlab2tikz, e.g. using

matlab2tikz('myfile.tex');

LaTeX

Add the contents of myfile.tex into your LaTeX source code, for example using \input{myfile.tex}. Make sure that the required packages (such as pgfplots) are loaded in the preamble of your document as in the example:

\documentclass{article}

  \usepackage{pgfplots}
  \pgfplotsset{compat=newest}
  %% the following commands are needed for some matlab2tikz features
  \usetikzlibrary{plotmarks}
  \usetikzlibrary{arrows.meta}
  \usepgfplotslibrary{patchplots}
  \usepackage{grffile}
  \usepackage{amsmath}

  %% you may also want the following commands
  %\pgfplotsset{plot coordinates/math parser=false}
  %\newlength\figureheight
  %\newlength\figurewidth

\begin{document}
  \input{myfile.tex}
\end{document}

Remarks

Most functions accept numerous options; you can check them out by inspecting their help:

help matlab2tikz

Sometimes, MATLAB(R) plots contain some features that impede conversion to LaTeX; e.g. points that are far outside of the actual bounding box. You can invoke the cleanfigure function to remove such unwanted entities before calling matlab2tikz:

cleanfigure;
matlab2tikz('myfile.tex');

More information

  • For more information about matlab2tikz, have a look at our GitHub repository. If you are a good MATLAB(R) programmer or LaTeX writer, you are always welcome to help improving matlab2tikz!
  • Some common problems and pit-falls are documented in our wiki.
  • If you experience (other) bugs or would like to request a feature, please visit our issue tracker.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap