Get from Ico-github-logo

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

  • ACID(k)
  • OSVersion()
  • StreamMaker()
    StreamMaker (Factory for fie/input/output Streams)
  • VersionControlIdentifier()
    This function gives the (git) commit ID of matlab2tikz
  • calculateMD5Hash(filename)
    CALCULATEMD5HASH calculate a MD5 hash of a file
  • cleanFiles(cleanBefore)
    clean output files in ./tex using make
  • cleanfigure(varargin)
    CLEANFIGURE() removes the unnecessary objects from your MATLAB plot
  • codeReport( varargin )
    CODEREPORT Builds a report of the code health
  • compareTimings(statusBefo...
    COMPARETIMINGS compare timing of matlab2tikz test suite runs
  • countNumberOfErrors(status)
    counts the number of errors in a status cell array
  • emptyStage()
    constructs an empty (workflow) stage struct
  • emptyStatus(testsuite, te...
    constructs an empty status struct
  • errorHandler(e)
    common error handler code: save and print to console
  • errorHasOccurred(status)
    determines whether an error has occurred from a status struct OR cell array
  • errorUnknownEnvironment()
    Throw an error to indicate an unknwon environment (i.e. not MATLAB/Octave).
  • example_bar_plot()
    Create figure
  • execute_hash_stage(status...
  • execute_plot_stage(defaul...
    plot a test figure
  • execute_save_stage(status...
    save stage: saves the figure to EPS/PDF depending on env
  • execute_tikz_stage(status...
    test stage: TikZ file generation
  • execute_type_stage(status...
  • figure2dot(filename, vara...
  • fillStruct(status, defaul...
    fills non-existant fields of |data| with those of |defaultData|
  • formatWhitespace(filename)
  • getEnvironment()
    Determine environment (Octave, MATLAB) and version string
  • getEnvironment()
    Determine environment (Octave, MATLAB) and version string
  • getEnvironment()
    Determine environment (Octave, MATLAB) and version string
  • getStagesFromStatus(status)
    retrieves the different (names of) stages of a status struct
  • guitypes()
    GUITYPES returns a cell array of MATLAB/Octave GUI object types
  • hasTestFailed(status)
  • hashTableName(suite)
  • herrorbar(x, y, l, u, sym...
    HERRORBAR Horizontal Error bar plot.
  • initializeGlobalState()
    Initialize global state. Set working directory and various properties of
  • isAxis3D(axisHandle)
    Check if elevation is not orthogonal to xy plane
  • isEnvironment(wantedEnvir...
    ISENVIRONMENT check for a particular environment (MATLAB/Octave)
  • isMATLAB(varargin)
    ISMATLAB Determines whether (a certain) version of MATLAB is being used
  • isOctave(varargin)
    ISOCTAVE Determines whether (a certain) version of Octave is being used
  • isVersionBelow(versionA, ...
    Checks if versionA is smaller than versionB
  • isVersionBelow(versionA, ...
    Checks if versionA is smaller than versionB
  • issues( k )
    ISSUES M2T Test cases related to issues
  • loadHashTable(suite)
  • m2tInputParser()
    MATLAB2TIKZINPUTPARSER Input parsing for matlab2tikz.
  • m2tUpdater(about, verbose)
    UPDATER Auto-update matlab2tikz.
  • m2troot(varargin)
  • m2tstrjoin( cellstr, deli...
    M2TSTRJOIN This function joins a cellstr with a separator
  • m2tstrjoin(cellstr, delim...
    This function joins a cell of strings to a single string (with a
  • makeLatexReport(status, o...
    generate a LaTeX report
  • makeTapReport(status, var...
    Makes a Test Anything Protocol report
  • makeTravisReport(status, ...
    Makes a readable report for Travis/Github of test results
  • matlab2tikz(varargin)
  • restoreGlobalState(orig)
    Restore original properties of global state.
  • runMatlab2TikzTests(varar...
    This file runs the complete MATLAB2TIKZ test suite.
  • saveHashTable(status, var...
    SAVEHASHTABLE saves the references hashes for the Matlab2Tikz tests
  • splitPassFailSkippedTests...
  • splitUnreliableTests(status)
  • testGraphical( varargin )
    TESTGRAPHICAL Runs the M2T test suite to produce graphical output
  • testHeadless( varargin )
    TESTGRAPHICAL Runs the M2T test suite without graphical output
  • testMatlab2tikz(varargin)
    TESTMATLAB2TIKZ unit test driver for matlab2tikz
  • testPatches(k)
    TESTPATCHES Test suite for patches
  • testSurfshader(k)
    TESTSURFSHADER Test suite for Surf/mesh shaders (coloring)
  • versionArray(str)
    Converts a version string to an array.
  • versionCompare( vA, opera...
    VERSIONCOMPARE Performs a version comparison operation
  • versionString(arr)
    Converts a version array to string
  • example_quivers.m
    Quiver calculations
  • View all files
4.9 | 178 ratings Rate this file 764 Downloads (last 30 days) File Size: 6.95 MB File ID: #22022 Version: 1.0.0
image thumbnail



Nico Schlömer (view profile)


07 Nov 2008 (Updated )

A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX.

Editor's Notes:

Popular File 2013 2015 2016

| Watch this File

File Information

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();
>> 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:
% and optionally (as of Pgfplots 1.3):
\pgfplotsset{plot coordinates/math parser=false}
There are reported incompatibilities with the following LaTeX packages:

signalflowdiagram (Check out
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


This file inspired Matlab2tikzext, Boxplot Correction For Tikz Export, Export Tex, Perf And Pub Tools, and Export Png Inkscape(Filename,Dpi,Handle).

MATLAB release MATLAB 8.4 (R2014b)
Other requirements LaTeX, Pgfplots
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (304)
21 Mar 2017 Matthew Taliaferro

I ran into a small problem while using this (wonderful) code. When the x-axis are labels, say from:

set(gca,'xticklabels',{'this\\is a','char\\label'})

the pgfplot file requires a line like:

xticklabel style={align=center},

to compile the xticklabels with the newline characters (it compiles just fine if the labels do not contain newline characters). matlab2tikz didn't seem to add the required line automatically. Thanks for all the great work!

Comment only
17 Mar 2017 Ganapati hegde


Does matlab2tikz support saving figures plotted using polarplot function available in MATLAB versions starting from 2016?

I could save figures plotted using 'polar' function, but not 'polarplot'.


Comment only
11 Mar 2017 Alan Rochford

01 Mar 2017 Egon Geerardyn

@Edward Kolanko: Thank you for the kind words. I presume it should be possible to generate an "empty" output document, by adding an empty axis in the MATLAB figure. However, I really wonder why you ask: is there something specific you are after? After all: a plot without contents is like a pub without beer ;-)

Comment only
01 Mar 2017 Edward Kolanko

This is very very good. I fell in love from the first graph.

I wonder if it is possible to generate tex code without drawing a graph in the figure.

Comment only
28 Feb 2017 Julio

Julio (view profile)

Amazing work! Works perfectly!

21 Feb 2017 Marie

Marie (view profile)

This package is great, thank you very much for all the work involved!

Recently, MATLAB changed their syntax for double axis plots, and the command plotyy() is not recommended anymore. When using yyaxis() instead (which is what they recommend) the figure doesn't have two axes objects anymore, but just one.
While matlab2tikz worked fine when there were two axes objects (handles of which could be retrieved with ah = findobj(gcf,'Type','Axes') ), it doesn't display the left-side plot any more in the new format. Could you possibly fix this? That would be of great help to me, thank you!

16 Feb 2017 Ola Øren

12 Feb 2017 Deepak Ingole

Dear Egon Thank you very much for your reply.

Comment only
11 Feb 2017 Egon Geerardyn

@Deepak Ingole: That is not an error message, just an informational message. We don't do a proper check on which version of pgfplots you have installed (since that is complicated to do in a platform-independent way). We do, however, check if your plot needs some features from more recent versions, and in that case we adapt that message accordingly.
The check is in there because quite a few people are stuck with an older version, and that way they know beforehand whether LaTeX will choke.

Note that the message reads "you will need pgfplots 1.3 OR NEWER", so you should be fine with 1.14.

If such informational messages bother you, you can add `'showInfo', false` to the parameters to matlab2tikz to suppress those messages (also have a look at `help matlab2tikz`, since there are a few more options to reduce the output to the console).

Comment only
11 Feb 2017 Deepak Ingole

Can somebody please help me to solve the issue of pgfplots version. I have pgfplots version 1.14 but still I am getting error as follows: "You will need pgfplots version 1.3 or newer to compile the TikZ output."

I tried in MATLAB 2015b.

Thank you.

10 Feb 2017 Hendrik Fuest

10 Feb 2017 Hendrik Fuest

08 Feb 2017 Nyasha Madziva

Thank you for the update. I am having a few issues with using the output file:
1. When a stacked figure (an area plot and regular y plot) is output to a .tikz or .tex file, and I attempt to use the figure in a Latex file, all the data points end up in different places than when originally plotted. In addition, the legend disappears, and the orientation that I had set the y-axis label (Orientation, '0') is reverted back to the default orientation of 90.
2. When I try to generate a figure using a general matlab2tikz output figure without any scaling size specified, I end up with a very large figure that extends way beyond the limits of the page. I have to always manually scale the .fig image down to a much smaller image, in addition to specifying a scaling value, (e.g. 'width', '0.5\textwidth') which I did not have to do with the older version.

Comment only
31 Jan 2017 Jonas Lenz

Great work!

As far as I understood the possibility to add the 'forget plot' option to surf-plots was missing. I just added the following lines to the function 'drawSurface':

if ~m2t.currentHandleHasLegend
% No legend entry found. Don't include plot in legend.
opts = maybeShowInLegend(false, opts);

It temporarily fixes the problem but I am not sure if it provides for all contingencies.

24 Jan 2017 Robert Brandalik

Amazing work!

19 Jan 2017 Abhinav Gaur

I am using Matlab 2016b. Strangely, when I produce the .tex using matlab2tikz,

1) the values for xticks are copied and reproduced in the figure instead of those of xticklabels.

2) the fonts is different from what I chose in Matlab.

Can you please direct me to relevant link where I can read about these issues and possibly solve them ?


Comment only
19 Jan 2017 Abhinav Gaur

amazing work. Kudos

09 Jan 2017 Buana

Buana (view profile)

Using it since many years. I really love it. Master or PHD thesis without is not even thinkable.

25 Nov 2016 adam taylor

Great package,
When exporting transparent patches (like from bounded Line for example), the patches transparency is set but the outline is drawn. The following could be added around line 3030 when setting face alpha
opts = opts_add(opts,'draw opacity',sprintf(m2t.ff,0));

12 Nov 2016 Markus Merklinger

12 Nov 2016 Markus Merklinger

28 Oct 2016 Nicholas

27 Oct 2016 Djibril TOGOLA

@Egon Geerardyn,

I understand...
So far, you did a great job. So, thanks again.

I suggest to other Tikz users who would like to use annotations to manually fix the exact cordonates they need. The following free application may help : GEOGREBRA.

Comment only
11 Oct 2016 Egon Geerardyn

@stefed: We are aware that we do not fully support yyaxis or other new constructs in R2015b/R2016a. You can still try plotyy (unless this has been removed from the last version of MATLAB). To be honest, I have not opened MATLAB in over a month.

Comment only
11 Oct 2016 Egon Geerardyn

@pankaj singh: This is not a problem of matlab2tikz, but rather a fundamental limitation of the LaTeX compiler you are using. Please read the documentation at,-sorry

Comment only
11 Oct 2016 Egon Geerardyn

@Djibril TOGOLA: I had a quick look in the source code regarding the Arrow problem. It was a known problem: this is something we still have to implement.

Comment only
11 Oct 2016 pankaj singh

@Egon Geerardyn... Thank you.... I was also getting the memory issue problem similar to @ragheb. like.. "TeX capacity exceeded, sorry [main memory size=3000000]". My figure was only 401KB.
Then i used, your suggestion of '0.3g', It reduced my figure size to 203 KB (almost 50%). So it worked for me. Thanks again.

I request author to please improver his code so that larger plots/graphs are converted automatically to the size acceptable by latex.

10 Oct 2016 pankaj singh

u can also use
\pgfplotsset{scaled x ticks=base 10:0}
\pgfplotsset{scaled y ticks=base 10:0}

in the preamble of your latex document to individually adjust the xtick labels and ytick labels...u can change by like 10:1, 10:2, ...etc. as per your required tick values.

10 Oct 2016 pankaj singh

doesnot include the ticks. why ???

Comment only
10 Oct 2016 pankaj singh

does include the ticks ???

Comment only
04 Oct 2016 Fabian Alexander Wilms

04 Oct 2016 Samuel

Samuel (view profile)

04 Oct 2016 Dan Thomsen

Great tool, thank you!

02 Oct 2016 Luuk

Luuk (view profile)

@hannes fischer
You would want this setting to remove the thousand separator:
'x tick label style={/pgf/number format/1000 sep=}'

If you have set up more settings for the x tick label style, it can look like this:

'x tick label style={rotate=90,anchor=east,/pgf/number format/.cd, fixed, fixed zerofill,precision=0,1000 sep=}'

26 Sep 2016 stefed

stefed (view profile)

Great, but I does not support the yyaxis function, which is new in MATLAB 2016a. Can you make this happen, please?

15 Sep 2016 Juan Reyes

Awesome! Thank you very much.

08 Sep 2016 Djibril TOGOLA

@Egon Geerardyn, I thank you for your kind suggestion, but I regret to inform you that it doesn't work too. The error remains unchanged :

Warning: Don't know annotation ''.
> In matlab2tikz>userWarning (line 5955)
In matlab2tikz>drawAnnotationsHelper (line 3079)
In matlab2tikz>drawAnnotations (line 3024)
In matlab2tikz>saveToFile (line 519)
In matlab2tikz (line 362)

The only way I found to fix the problem is to manually add annotations into the tikz file. This is costly because it requires to find the exact coordinates.

Comment only
08 Sep 2016 Egon Geerardyn

@Djibril TOGOLA: I think with the upcoming release (1.1), this should no longer happen. You can already get this version from our develop branch on GitHub ( )

Comment only
04 Sep 2016 Ivan Abraham

The file does not work with quiver plots. I have been able to reproduce the same error on versions 2014a, 2014b and 2016a. The error is the following:

Matrix dimensions must agree.

Error in matlab2tikz>drawQuiverGroup (line 3661)
data(4,:) = x + u;

Error in matlab2tikz>drawHggroup (line 2466)
[m2t, str] = drawQuiverGroup(m2t, h);

Error in matlab2tikz>handleAllChildren (line 654)
[m2t, str] = drawHggroup(m2t, child);

Error in matlab2tikz>drawAxes (line 852)
[m2t, childrenEnvs] = handleAllChildren(m2t, handle);

Error in matlab2tikz>saveToFile (line 450)
m2t = drawAxes(m2t, relevantAxesHandle);

Error in matlab2tikz (line 352)
saveToFile(m2t, fid, fileWasOpen);

Error in hw1p1 (line 22)

Otherwise excellent work!

02 Sep 2016 Alan

Alan (view profile)

Tests, both Headless and Graphical, fail on a Mac running MATLAB Version: (R2016b) Prerelease.

Comment only
30 Aug 2016 Djibril TOGOLA

With the latest version of Matlab (2015b), I find the following bug :

Warning: Don't know annotation ''.
> In matlab2tikz>userWarning (line 5316)

With the previous versions of Matlab, such an error did not occur. So, what do you think about that?

Comment only
29 Jul 2016 Djibril TOGOLA

The tool is perfect. Congratulations and thank you!

23 Jul 2016 Beenwa

Beenwa (view profile)

29 Jun 2016 Egon Geerardyn

@sreenath M.G.: Thank you for the kind words! If there are recurring nuisances that pop up (or minor modifications that you feel are necessary every time), please do not hesitate to report an issue on GitHub and we will see what can be done about it :-)

Comment only
29 Jun 2016 Sreenath M. G.

"matlab2tikz" does a great job in converting matlab/gnu octave plots to pgfplots/tikz and saves a lot of time and effort. Axes, ticks, labels, grid etc. are perfect in the tikz output. Now there is no need to write the variables to delimited files to plot with pgfplots. Minor modifications are needed before inserting the tikz code in LaTeX. That is always the case if we convert from one format to other. A great package! Thanks to developer(s).

29 Jun 2016 Egon Geerardyn

@Matthew Taliaferro: Thank you for the kind words! Currently, there is no support for adding own code at random places in the output. However, there is some support planned (and almost completely implemented) for this to work. You can monitor the progress at

Comment only
28 Jun 2016 Matthew Taliaferro

I absolutely love this program, my thesis would be a pain without it. Is there a way to add something like this to the output tex file from a matlab script?

\addplot [color=black,solid,line width=1.0pt,domain=0:1,samples=11]{x+x^2};
\addlegendentry{Eq. \ref{eq:equation}};

Most of my graphs are a mix of scattered data and functional data. Sometimes it would be nice to graph the functional data using pgfplots native graphing utility.

Comment only
15 Jun 2016 Egon Geerardyn

@Stefan Schiessl: Thank you for the kind words! Is there a reason why you would like to see this as a toolbox? A year ago, we have evaluated whether or not to provide it as a toolbox. Back then (I cannot speak for the situation right now, but I assume little has changed) it was impossible to integrate MATLAB toolboxes, MathWorks's FileExchange and GitHub in a decent way (i.e. without storing big binary blob files that may go outdated in our git repository). Back then, this disadvantage vastly outweighed the few advantages of a toolbox (basically: one-click install and distribution). But we are certainly willing to reconsider this decision.

Comment only
15 Jun 2016 Stefan Schiessl

Reliable tool to create fancy plots for LaTeX!

Are you thinking about providing it as a toolbox?

12 Jun 2016 Egon Geerardyn

@Jonas: Many of the standard MATLAB properties of lines are translated to TikZ, e.g. if you set the "LineWidth" of a plot in MATLAB, this will add "line width=..." to the corresponding value. If you want to have a more low-level access to tweaking the TikZ code (e.g. things for which there is no MATLAB counterpart), in a future release this will be included. There is already an experimental implementation at which works quite well.

Comment only
10 Jun 2016 Jonas

Jonas (view profile)

Is it possible to add a property to addplot? Sth like

addplot[...,line width=2pt]

line width=2pt

automatically without reopening the tikz files??

Comment only
03 Jun 2016 Egon Geerardyn

@Lairenlakpam Joyprakash Singh: Please report future problems on our GitHub. In this case, there are a few errors with your code: the value you provide to 'floatFormat' is incorrect, it should be something like '%0.3f' or '%0.3g' instead. Also, it is recommended to put the filename as first argument, not as the last one). This has not changed since old versions: the float format has been like that for years.

Comment only
02 Jun 2016 Lairenlakpam Joyprakash Singh

Thanks. I got it after I read the article at,-sorry

It works when I use LuaLaTeX. However, using of other commands like cleanfigure() as well as matlab2tikz('floatFormat','%0.3','myfile.tikz') did not work as later plots only axes [no waveform].

My MATLAB code was:
%wavplay(signal,Fs); % for Windows based machines
sound(signal,Fs); % for Mac based machines

Source wav file is from Open Speech Repository at:

Comment only
01 Jun 2016 Egon Geerardyn

@Lairenlakpam Joyprakash Singh: You might want to report the problems you are experiencing on our GitHub page together with an explanation how we can reproduce them.

Comment only
01 Jun 2016 Lairenlakpam Joyprakash Singh

Earlier version with three files namely, matlab2tikz.m, matlab2tikzInputParser.m, and updater.m, work beautifully on fewer points plot of sine waves and others in 2014 but now I can't use earlier version/even this latest version to export speech signal plot from MATLAB to pgf :-(

Comment only
01 Jun 2016 Lairenlakpam Joyprakash Singh

Earlier version with three files namely, matlab2tikz.m, matlab2tikzInputParser.m, and updater.m, work beautifully on fewer points plot of sine waves and others in 2014 but now I can't earlier version and even this latest version make create speech plot from MATLAB to pgf :-(

Comment only
21 May 2016 Taher

Taher (view profile)

Just what I needed. Keep up the fantastic work

11 May 2016 Hank theTank

30 Apr 2016 Orides Golyjeswski

27 Apr 2016 Jun Liu

Very useful and working very well. Well done! Really appreciate that the developer has kept it update.

06 Apr 2016 Egon Geerardyn

@Ingrid: it's currently not possible to pass different parameters for different subplots. I see a few solutions for your problem:

(1) I think it should be possible to call cleanfigure by passing an axes handle instead of the figure handle. So if you call cleanfigure for each subplot using different parameters, that should do the trick, I think.

(2) If the above does not work; split your subplot over different figures, run cleanfigure on each plot, and then recombine those plots as subplots in one figure (there are some functions on FileExchange and StackOverflow that help with those steps).

(3) In the develop branch on GitHub, there is a new simplification algorithm that uses the size of the subplots (and resolution and so on) to simplify your traces. That should be more reliable than the version here and might work better using a single figure-wide setting.

Comment only
06 Apr 2016 Ingrid

Ingrid (view profile)

I am running out of memory so I need to apply the cleanfigure. However, the scale of my different subplots is not the same so I need to apply different precisions to each subplot instead of one and the same value to all subplots - how can I achieve this???

Comment only
17 Mar 2016 Ingrid

Ingrid (view profile)

17 Mar 2016 Egon Geerardyn

@Ingrid: Those changes haven't been propagated to the version you can download here. If you want to try out those new features, please download instead.

Comment only
17 Mar 2016 Ingrid

Ingrid (view profile)

according to this having one legend instead of two should be fixed for plotyy but I still get two legens

Comment only
12 Mar 2016 Jeremy Diallo

This script is a blast. It makes for the most beautiful scientific reports I have even seen in my life. Keep up the good work !

07 Mar 2016 Renard Xaviero Adhi

17 Feb 2016 Alfons

Alfons (view profile)

16 Feb 2016 Egon Geerardyn

@hannes fischer: The number formatting can be set using the 'pgf/number format' options in your LaTeX document. More information can be found in the TikZ manual ( ), but also the pgfplotstable manual ( ) contains a lot of information.

Comment only
15 Feb 2016 hannes fischer

Hello everyone,

thank you for this tool. This helps me a lot and the plots look very good. But I'm looking for a solution of my problem for hours unsuccessfully.

Here it is:
I only want to sererate thousands without anything, I don't want a number like this: 2,000. I only want it this way: 2000.
In which line of the script do I change it?

Thank you!

Comment only
07 Feb 2016 Egon Geerardyn

@Raph: Thank you reporting the bug concerning markerEdgeColor! We will fix that.
The scatterplots with both changing sizes and colors, unfortunately, is something that is currently not supported. The thing is, both get set using the same mechanism in pgfplots (i.e. meta data), so specifying one will conflict with the other. I think there might be a way around that, but it might take quite some time to implement that.

Comment only
07 Feb 2016 Raph

Raph (view profile)

When the colors of the scatters are set by a colormap, the scaling of the scatter markers is also not working. When all scatters are having the same color it works fine.

Comment only
07 Feb 2016 Raph

Raph (view profile)

Great tool, thanks a lot.

Using scatter() I get the error

> Undefined function or variable 'markerEdgeColor'.
> Error in matlab2tikz>getScatterOptsColormap (line 3237)
> [m2t, ecolor] = getColor(m2t, h, markerEdgeColor,'patch');

Adding the line
> markerEdgeColor = get(h, 'MarkerEdgeColor');
helps, maybe you can include this or provide a better fix.

07 Feb 2016 Wendelin

25 Jan 2016 Egon Geerardyn

@Cornelius Thies: Datetime values on the x-axis has been added to our development release for MATLAB 2014b and newer. You can get this version by downloading the "develop" branch on GitHub (and otherwise, it will be release here as well, but I can't promise any date yet).

Comment only
25 Jan 2016 Cornelius Thies

This tool is so helpful for creating nice plots in Latex files - thank you!
However, I have encountered one problem: I have a plot with datetime-values as the x-axis. When exporting the plot to a tikz file, only numeric values are shown instead of correct dates. Can this problem be solved?

Comment only
22 Dec 2015 Artiom Kovnatsky

15 Dec 2015 Egon Geerardyn

@Andries: We do support contourf plots :-) (do make sure you have version 1.0.0 or newer). Many of those plots should work without a problem, but I have to admit there are some parts that are not yet implemented, see But those will surely be tackled in a future version.

Comment only
14 Dec 2015 Andries

Great file, but please support contourf plots!

24 Nov 2015 Tina Fuhrmann

Thanks Egon!

Comment only
23 Nov 2015 Egon Geerardyn

@Tina Fohrmann: that is just a warning because matlab2tikz cannot determine what the phyiscal size of the figure is in physical units. You can turn this warning off using "warning off MATLAB2TIKZ:UnknownPhysicalUnit". But probably the best solution is to reset the units back to a physical one: "set(figureHandle, 'Units', 'inch')" (or any other MATLAB unit you prefer) after you have executed the code you provided. Then MATLAB takes care of the conversion.

Comment only
23 Nov 2015 Tina Fuhrmann

Thanks for the great file!
I get the following error
Warning: Can not convert unit 'normalized'. Using conversion factor 1.

when resizing a figure:
set(figureHandle,'Position',[0 0 0.6 0.75]);

Is there something I can do?

12 Nov 2015 Jeremy

Jeremy (view profile)

22 Oct 2015 Egon Geerardyn

@Sebastian Bomberg: I have added this feature request on our GitHub tracker.

@Selwyn: We do have some support for 3D histograms, but it is quite limited. In the link that you mention, Nico shows an example of 3D histograms as well. However, as you can see on, it's currently very hard to fully support such figures due to multiple reasons.

Comment only
22 Oct 2015 Eneko Unamuno

21 Oct 2015 Sebastian Bomberg

Thank you Nico for this great contribution!

I'm facing a little issue regarding iso contours though.
Apparently, the line spec of couture lines is ignored.

%start code

Z = peaks();


hPC = pcolor(Z);

hPC.FaceColor = 'interp';
hPC.EdgeColor = 'interp';
hPC.LineStyle = 'none';

hold all;

contour(Z, '-k', 'ShowText', 'on');

hold off;


contour(Z, '-k', 'ShowText', 'on');


%end code

counter lines should appear black but get drawn with the same colormap as the patches from pcolor. Thus you can't see them. It becomes more clear in the 2nd subplot.

I'd really appreciate your help.


02 Oct 2015 Selwyn

Selwyn (view profile)

Great code! Use it all the time. Many thanks!
I would like to suggest support for the histrogram2 object. More about it can be found at: .

Comment only
02 Oct 2015 Selwyn

Selwyn (view profile)

14 Sep 2015 Jeremy

Jeremy (view profile)

Thanks for the great package!

10 Sep 2015 Jan Studený

20 Jul 2015 matlab2tikz

@E. Ch3yn3t: you may want to try the `cleanfigure` function that is provided to clean up your data. If that doesn't clean many NaNs, feel free to submit a feature request on github at

Comment only
20 Jul 2015 E. Cheynet

20 Jul 2015 E. Cheynet

Excellent initiative !

A given plot may contain many NaN values.
I wonder if it is possible to implement inside this script a method to automatically remove the NaN values from the created tikz file. The goal would be to reduce the size of the created file, and to increase its readability.

20 Jul 2015 E. Cheynet

25 May 2015 Egon Geerardyn

@PatronBernard: that's very possible, yes. We will communicate this dependency more clearly in the upcoming release.

Comment only
25 May 2015 PatronBernard

Addendum: possibly when the title of the figure contains LaTeX markup.

Comment only
25 May 2015 PatronBernard

Brilliant piece of software. However, is it possible that your minimal working example requires the inclusion of the amsmath-package?

15 May 2015 Ahmed Badr

Fantastic work ...

06 May 2015 Harm

Harm (view profile)

04 May 2015 F A

F A (view profile)

Works great! Great job! The cleanfigure() function is also awesome

04 May 2015 David E. Horsley

23 Apr 2015 Johannes

20 Apr 2015 Egon Geerardyn

@redfixie: Can you please report this on our GitHub (together with a small piece of MATLAB code to reproduce this issue and what version of matlab2tikz and MATLAB you are using). Thanks!

Comment only
20 Apr 2015 redfixie

Hi, I've a quick question. When I convert a stacked bar chart using matlab2tikz LaTek only shows the final colour across the bars not the full range. Any advice?

04 Apr 2015 Sergei Paleichuk

31 Mar 2015 Peter Pablo

The problem of Olivier is fixed in the development version.

Comment only
21 Mar 2015 Oleg Komarov

Oleg Komarov (view profile)

Hi Olivier, can you please report this on with a minimal code example that reproduces the problem?

Comment only
20 Mar 2015 Olivier

Works very well, except for the sign | in label, I need to edit the .tex and replace | by $|$. Is there another trick to do that?

06 Mar 2015 ADITHYAN

Wonderful. Thank your very much for the tool.

03 Mar 2015 onewhaleid

02 Mar 2015 Abdoulaye Sanni

01 Mar 2015 els

els (view profile)

27 Feb 2015 David E. Horsley

20 Feb 2015 Stephan Münzberg

Again I have to thank you for your great tool, Nico Schlömer. I have only a kind request. Is it possible to check automatically if a diagramm was produced by ternplot function and then export it to tikz with the ternaryaxis-features of pgfplots?

20 Feb 2015 Stephan Münzberg

18 Feb 2015 Nikolay

28 Jan 2015 Alex

Alex (view profile)

21 Jan 2015 Oleg Komarov

Oleg Komarov (view profile)

@Janis histogram support has been added in the developing branch and will be part of the next release.

Comment only
20 Jan 2015 Janis

Janis (view profile)

It appears that the new histogram feature introduced in R2014b is not yet supported:

Error using matlab2tikz>handleAllChildren (line 664)
I don't know how to handle this object: histogram

Comment only
08 Jan 2015 Oleg Komarov

Oleg Komarov (view profile)

@dsaf This issue for R2014b (HG2) has been fixed in the developing branch and will be part of the next release.

Comment only
08 Jan 2015 dsaf

dsaf (view profile)

08 Jan 2015 dsaf

dsaf (view profile)

@Oleg: Here is a minimal version for the issue:

% Load a user-defined colormap matrix
fig1 = figure(1);

% This will create no colorbar at all in the tikzpic
matlab2tikz('figurehandle', fig1, 'test.tex');

Comment only
08 Jan 2015 Oleg Komarov

Oleg Komarov (view profile)

@Thomas: please submit an issue on providing a minimum example that reproduces the error (including version of Matlab and matlab2tikz used).

@dsaf: can you elaborate on what you mean by "did not work out"?

Comment only
08 Jan 2015 dsaf

dsaf (view profile)

The new colorbar functionality as of MATLAB R2014b (<=> colorbar object instead of axes object) is not yet supported, right?

I tried to save an image w/ an user-defined colormap, but it did not work out...

Comment only
07 Jan 2015 Thomas

Thomas (view profile)

Great tool, it makes work lot easier! Thanks!

But with a big plot, including a colorbar I get an error, already reported on 2013/05/12.

Error using matlab2tikz>patchcolor2xcolor (line 3699)
Don't know how to handle the color model 'interp'.

Error in matlab2tikz>getColor (line 3646)
[m2t, xcolor] = patchcolor2xcolor(m2t, color, handle);

Error in matlab2tikz>drawPatch (line 1786)
[m2t, xEdgeColor] = getColor(m2t, handle, edgeColor, 'patch');

Error in matlab2tikz>handleAllChildren (line 620)
[m2t, str] = drawPatch(m2t, child);

Error in matlab2tikz>drawAxes (line 838)
[m2t, childrenEnvs] = handleAllChildren(m2t, handle);

Error in matlab2tikz>saveToFile (line 438)
m2t = drawAxes(m2t, relevantAxesHandle);

Error in matlab2tikz (line 349)
saveToFile(m2t, fid, fileWasOpen);

I'm using Matlab R2013a. Maybe anybody can help?

Comment only
04 Dec 2014 Egon Geerardyn

@Ragheb: We also have some information on how to tackle your problem in our wiki at,-sorry

Comment only
04 Dec 2014 Andreas

Hi Ragheb,

To increase memory when using large PGF or TIKZ figures, for MikTEx use the command line:

initexmf --edit-config-file=latex

opens an editor where you can put the new values. E.g.


Afterwards call the next for updating the latex format files.
initexmf --dump=latex

FOr PDFlatex, replace in both cases latex with pdflatex

03 Dec 2014 Ragheb

Ragheb (view profile)

Why Latex doesn't compile large tikz files?

I have tried matlab2tikz on a three dimensional sphere figure from matlab and it works perfectly because the corresponding tikz file is only 50KB. However, the figures I want to include in the tex file often exceed 100MB! Latex refuses to compile such files giving me the error :" TeX capacity exceeded, sorry [main memory size=5000000]".

Can you please advise me how to solve that problem?

Comment only
07 Nov 2014 Peter Pablo

@Pepijn, I reported your issue as well:

Comment only
06 Nov 2014 Peter Pablo

@Konrad Stahl,
this is already reported and will be improved. See

Comment only
06 Nov 2014 Konrad Stahl

In the new version it always adds:

every outer x axis line/.append style={white!15!black},
every x tick label/.append style={font=\color{white!15!black}}

to the TeX-Code (and also for the y-axis), even if I use

ax = gca;
ax.XColor = 'black';
ax.YColor = 'black';
ax.ZColor = 'black';

in the Matlab-Code.

Is there a way to change this? I dont't want grey axes and I dont't want to change that manually every time.

Comment only
04 Nov 2014 Egon Geerardyn

@Monika: In versions before 2014b most annotations are supported. In 2014b, we haven't implemented them yet.

Comment only
01 Nov 2014 Monika

Monika (view profile)

Does it support annotations in Matlab? It will not plot arrow or text boxes

Comment only
01 Nov 2014 Monika

Monika (view profile)

Does it support annotations in Matlab? It will not plot arrow or text boxes

Comment only
01 Nov 2014 Monika

Monika (view profile)

Does it support annotations from Matlab? It will not plot any arrows or text boxes.

Comment only
24 Oct 2014 Egon Geerardyn

@arnold: I asked Nico to put that link at the top to reduce the amount of bug reports here and get more feedback on Github instead.

As you can see from the history of updates, we only rarely have a new release (the last one was in April) and we are very conscious about publishing them (I agree with you that such lists should not be polluted, and we try not to).

The last update here was around the time when we released the 0.5 version as well. But since FileExchange now integrates with our master branch on Github, it has become less clear what an update is: there is no manual process involved where Nico updates this page. Together with The Mathworks, we are currently looking into what a good way is to combine both GitHub and the FileExchange and provide new releases in a clearer way. Anyhow: whie this page hasn't been altered in a significant way, the code has :-)

Comment only
22 Oct 2014 arnold

arnold (view profile)

Hi Nico,
very useful tool and thanks very much for that.

A rather unusual remark/question: I'm confused by all the 'updates' you've been undertaking. I try to keep the files I use updates hence I check this website regularly. You have 'updated' the contribution several times under the pretense of 'present the contribution link more prominently'. I suppose you don't just do this to bump this file up the 'most recent' list but I can never find an update.

I guess I'm not the only one spending time to check for whatever it is you updated in the code. As good as the code is, the 'recently updated' list on the file exchange becomes rather useless if everybody did that, or are you trying to move everybody over to github :)

Comment only
21 Oct 2014 Markus

Markus (view profile)

most useful script I use, great work :)

20 Oct 2014 Egon Geerardyn

@Vegar: m2t uses the plot units set in your figure, and those are inches by default. You can either change those or manually supply them with the options `width` and `height` (there you can also use `\textwidth`, `\columnwidth` etc.).

@Todd: font sizes are respected if you supply the `strictFontSize` option.

@Jan: `contour` is translated to a pgfplots `contour` since m2t v0.5 on MATLAB 2014b or higher. (`contourf`, however, isn't supported yet in that case).

Comment only
16 Oct 2014 Peter Pablo

16 Oct 2014 Vegar Ottesen

The submission is EXCELLENT! However, by default it defines a plot width and height in inches, conforming to US paper standards, as opposed to ISO A4, which is more common globally.

Might I suggest a change in plot width to a fraction of \textwidth instead?

15 Oct 2014 Oleg Komarov

Oleg Komarov (view profile)

13 Oct 2014 Egon Geerardyn

26 Sep 2014 Roberto


25 Sep 2014 Todd

Todd (view profile)

Great! needs a few more options though.

1. Specify font size of axes, legend, etc.

2. When there are multiple axes in a given Matlab figure, the axes are not spaced properly in latex.

3. Option to include extra code inside the tikzpicture environment.

19 Sep 2014 Per

Per (view profile)

26 Aug 2014 Grunde

Grunde (view profile)

I use this all the time!

21 Aug 2014 fernando ramos

nice job

15 Aug 2014 Jan Kappen

Extremely good.

But two little questions:
First one: Are contour plots supported? I mean the pgfplot's contour. If I use 'contour(peaks(20),10);' and export it with m2t only area plots are used.

Second one: If I use 'contourf', the ticks are invisible, tick labels are there. Is that a bug?

Thank you!

08 Aug 2014 Sharah

Sharah (view profile)

I hope anyone can answer this. This words fine if i plot a figure and then just change it to tikz.

But a problem comes when I try to add some personalised text on the figure, and when i try to include it in tex file, it says error something like

Package pgfplots Error: the arguments of [mesh/rows=2,mesh/cols=0] assume 0 p
oints, but I got actually N = 1 points! The data matrix appears to be incomplete

Comment only
07 Aug 2014 Aaron

Aaron (view profile)

Thanks a lot!

16 Jul 2014 Georg

Georg (view profile)

I have a custom positioned colorbar, the script doesn't account for that yet. Might that be something you're looking into in the future?

Comment only
01 Jul 2014 Simone

Simone (view profile)

For the version 2014b it has problems. For instance the legend disappears.

Comment only
24 Jun 2014 Nico

Nico (view profile)

Thanks for this excellent script!

I experienced two issues, which I tried to solve with some hacking of the code (use with caution :)
(I am running R2013a and pdflatex)

1) multi-line legend entries:
Minimal working example: in matlab, run:
figure; plot(1:10, 1:10); legend(sprintf('This is a \n multiline legend entry'))
matlab2tikz('filename', 'm2ttest.tex', 'width', '0.8\columnwidth', 'height', '5cm')
In latex:
\pgfplotsset{plot coordinates/math parser=false}
---after \begin{document}---
\caption{TIKZ Test}

Result: the legend entry appears in one line. There is a line break in m2ttest.tex which latex ignores.
My attempt to fix this:
a) change in function prettyPrint, line 4840 (see diff at bottom)
b) change in line 731 (see diff at bottom): add "[align=left]" to "\addlegendentry". Without this, my latex aborts with an error if a line break "\\" is used in the legend entry. I have seen that matlab2tikz sets the legend style to "legend cell align=left". Why the additional, explicit specification "align=left" is necessary is strange... maybe I am doing something wrong?

2) Positioning of the legend:
when I move the legend to, say, the bottom left of the figure (in the gui), it does not appear (exactly) at this position in latex. The problem seems to be that in matlab, the legend position is relative to the figure, while in tikzpicture, it is relative to the axis. Starting at line 3646, matlab2tikz seems to try to determine whether the matlab position is relative to figure or axis (unit = "normalized" or "pixel"). In my case, the unit is "normalized", but the position is still relative to the figure. So I just modified the script to always act as if the unit was "pixels" (copied the code from the "case 'pixels'" to the "case 'normalized'"). After that, legend positionig worked as expected.

What I modified in matlab2tikz.m:
diff matlab2tikz.m.orig matlab2tikz.m
< sprintf('\\addlegendentry{%s};\n\n', join(m2t, c, '\\'))]; %#ok
> sprintf('\\addlegendentry[align=left]{%s};\n\n', join(m2t, c, '\\'))]; %#ok
< position = legendPos(1:2);
> %position = legendPos(1:2);
> % Calculate where the legend is located w.r.t. the axes.
> axesPos = get(m2t.currentHandles.gca, 'Position');
> % By default, the axes position is given w.r.t. to the figure,
> % and so is the legend.
> position = (legendPos(1:2)-axesPos(1:2)) ./ axesPos(3:4);
> %now that all the character arrays in strings are 1-dimensional, we additionally need to split strings at newline characters
> strings = cellfun(@(x)strsplit(x, sprintf('\n')), strings, 'UniformOutput', false);
> strings = [strings{:}];

22 Jun 2014 Saliou

Saliou (view profile)

Add these lines at the end of your script before running. It did work for me

axoptions={'scaled x ticks = false',...
'x tick label style={/pgf/number format/.cd, fixed, fixed zerofill,precision=3}'};


15 Jun 2014 NGUYEN

NGUYEN (view profile)

Dear author,
while testing your package, it find it really interesting. However, i met this error sometimes:

"Attempted to access CData(:,1); index out of bounds because size(CData)=[0,0].

Could you tell me what happened please!

Comment only
15 Jun 2014 NGUYEN

NGUYEN (view profile)

thanks so much, it is really useful

13 Jun 2014 Luuk

Luuk (view profile)

13 Jun 2014 Ulrik Nielsen

Very useful, thank you!

30 May 2014 Fariborz

27 May 2014 Martin

Martin (view profile)

Excellent package. Thank you for your work.

21 May 2014 HA

HA (view profile)

14 May 2014 mikemodanoxxx


Really nice tool. I just tried to convert a figure which uses scatter(X,Y,[],C) to draw circles with different colors.

There seems to be a bug in your code (or the feature is just not implemented yet) in the getColor(m2t, handle, color, mode) function. It doesn't seem to be able to handle multiple colors.

A simple example would be this:
scatter([1 2], [1 2], [], [0 0 0; 0 1 0]);

Which results in an error. Do you think you can fix this? Would be absolutely great ;)

12 May 2014 Kine

Kine (view profile)

Love the way te figures look! But I have one question, is there any way I can force the limits for the axis ? For example I am making a figure that has the values 0.005, 0.006... on the x-axis, and when I put the figure in to Latex I get 0.5 * 10^{-2}, is there anyway I can force it to be as it originally was? And Is there anyway to force the y-limits to be spesific values?

07 May 2014 Jan

Jan (view profile)

20 Apr 2014 William Warriner

Instant five stars for you because not only is it quite powerful, as noted, but also extremely easy to use. Thank you!

14 Mar 2014 Fabian Abarca

An essential tool from now onward when working in Matlab/LaTeX. There is, though, some trouble in the legends of the plots when TeX symbols or code is introduced (say P_e) and the tikz file takes it as plain text, but I guess it can be fixed (I do it manually in the generated file). Excellent file, thanks.

13 Mar 2014 Aaron Jackson

A very useful little tool to have in your MATLAB path. :)

28 Feb 2014 steffen

first of all, really nice tool! it produces the most beautiful plots in combination with TeX by far!

Just a little question, in order to match german typography I replace all the point seperators by comma seperators -before- using matlab2tikz.
That works pretty well for axis labels, the title and the tick labels. But there seems to be a problem concerning the legend entries:

Some of my legendentries contain numbers which are seperated by points since they are created dynamically using num2str(). They are written in combination with some descriptive text. So one legendentry could be:

$\lambda = 1.5$, $Delta = 3.4$

after replacing the points by commas it could be
$\lambda = 1,5$, $Delta = 3,4$
$\lambda = 1{,}5$, $Delta = 3{,}4$ (I tried both types).

After using matlab2tikz on the figure, the "original" comma in the legendentry is kept, while the seperator commas are replaced by point seperators again...

I hope you understand what I mean and maybe you've also got some hints on solving that problem


Comment only
07 Feb 2014 Nico Schlömer

Nico Schlömer (view profile)

Setting externalData to true by default was a mistake; a new release will be out shortly, fixing this.

Comment only
05 Feb 2014 Daniel

Daniel (view profile)

'ExternalData', false
Or rtfm

04 Feb 2014 Vincent Nadon

I think the compiler is complaining about the missing "\\" in the .tsv file

04 Feb 2014 Felix

Felix (view profile)

04 Feb 2014 Felix

Felix (view profile)

Hey there,

I updated today to version 0.4.5 and there are several .tsv-files created instead of one large .tikz-file.

that may be advantageous for many of you, but I'd rather have one large .tikz-file.

Is there any way to change it back?

Comment only
29 Jan 2014 Tina

Tina (view profile)

I figured out the problem:
The texlive version for Ubuntu still uses pgfplots 1.8 but for the newest matlab2tikz file pgfplots 1.9 is necessary (for plots with errorbars).
It's somewhat a pain to install pgfplots 1.9 in ubuntu but after doing so it works fine again.

Maybe with the next update there could be a hint that another pgfplots version is needed.

Comment only
27 Jan 2014 Tina

Tina (view profile)

Hey there,
I just love matlab2tikz, thanks for the file!

Unfortunately I have a problem with the errorbars now:
In the older version v0.4.2 points and bars were defined as (x,y)+-(xerr,yerr)... .
Now in version v0.4.4 it is (x,y) += (xerrup,yerrup) -= (xerrdown,yerrdown). It doesn't work for me to compile that file in texmaker. Did anybody have the same problem and/ or knows how to solve this?

Thank's for your help.

16 Jan 2014 piyush kant

great work for LaTex.

15 Jan 2014 Thor Andreas

09 Jan 2014 Karl

Karl (view profile)

09 Jan 2014 Karl

Karl (view profile)

09 Jan 2014 Karl

Karl (view profile)

07 Jan 2014 Erik

Erik (view profile)

This is such a great addition for anyone using both MATLAB and LaTeX! Five stars for the awesomeness. *****

On minor problem I encountered today:
I get a warning when using cleanfigure.
---Warning: Ignoring unknown argument "minimumPointsDistance"---
That is the exact argument copied from the help of function cleanfigure(). I don't get the error when using 'minimumPointDistance' ("Point" instead of "Points"). Just thought I'd let you know!

12 Nov 2013 Nikolai

12 Nov 2013 AP

AP (view profile)

08 Nov 2013 Jørgen

I think there is a problem when exporting bar plots while using the 'figurewidth' variable to enable setting the figure size in Latex. The width of the bars are set to the same value as 'figurewidth'. This makes the bars way to wide.

02 Nov 2013 Nico Schlömer

Nico Schlömer (view profile)

@Anfänger Sounds like a bug. If you want it fixed, file a report at <> with a minimal MATLAB example that highlights the misbehavior.

Comment only
31 Oct 2013 Anfänger

Just a small correction for my question: by labels, I mean , when I put contour labels withing box, the box is ignored by matlab2tikz. If for example I swich axis position (x-axis in the top), the label is still written at the bottom by matlab2tikz

Comment only
31 Oct 2013 Anfänger

@Nico Schömer , many thanks for the great job. If you allow me, I would like to ask Why is the m2t ignoring for example labels, added texts...etc?

Comment only
28 Oct 2013 Nico Schlömer

Nico Schlömer (view profile)


1. There is the option 'extraAxisOptions'. If that doesn't work for you, you could file a bug at <>.

2. There's cleanfigure() to help you out.

3. That's possible, you're probably the first to use step/impulse plots with m2t. It'd be great if you could file a bug and provide minimal failing examples.

Comment only
26 Oct 2013 Matthias

How do I use the cleanfigure() function? I need to reduce the number of datapoints in my plot. I run cleanfigure() but nothing changes. Can someone help me?

Comment only
23 Oct 2013 Thomas Bosse

So cool! Thank you!

23 Oct 2013 lyxicon

Pretty amazing submission. I have only had a few minor issues with it:

1. There is no way to provide extra axis options (e.g height and width) for each subplot. This is especially needed when you have a few vertically stacked subplots with a common x-axis and you want to remove the x-axis labels from all subplots but the bottom one, or you want different heights from each subplot.

2. It needs a better (smarter) downsampling algorithm. Currently, it is very easy to hit TeX memory limits when you have a large number of points (see

3. It cannot properly convert time graphs that are automatically generated by step(), impulse() functions and the like (from control system toolbox)

07 Oct 2013 Andrey Ivanov

This is very cool thing, the result looks really great than png images.

01 Oct 2013 Anfänger

Excellent!It did in fact save a lot of time and work. I am new to tikz, and would like to ask, is there a way to generate both the .*tikz and *.pdf files? without the need to open the .*tikz file in an external editor and generate the pdf version.

25 Sep 2013 José Goulart

Very practical, and the result looks really great.

29 Aug 2013 Svenja Woicke

is it possible to change the code such that the "point meta min" and "point meta max" values are always saved so in case i choose for adding a colorbar later on it will show the right scale?

14 Aug 2013 Nico Schlömer

Nico Schlömer (view profile)

@Maria Filing your problems at with some minimal example code that highlights what goes wrong would make it much easier to fix the issues.

Comment only
14 Aug 2013 Marco

Marco (view profile)

24 Jul 2013 Dominique Zosso

Absolutely great tool!

The whitespace issues (cf Christoph, March 25, 2013) have not entirely been fixed, though (v.0.4.0):

Around the "definecolor" lines, some more '%' should be placed:

line 555: put an extra %% in front

m2t.content.colors = sprintf('%%\n%% defining custom colors\n');

line 562, too:

m2t.content.colors = [m2t.content.colors sprintf('%%\n')];

Thanks for adding this in future updates! Great work!

19 Jul 2013 Robert

Robert (view profile)

Love this tool but what happened to the minimumPointsDistance option? I can't find it anywhere... Has it been removed in the current versions? Does anybody know a tool that could reduce data points in figures before matlab2tikz takes over?


10 Jul 2013 Maria

Maria (view profile)

Really nice package! Many thanks!

I am facing some problems though related to subfigures.

1) The error - bars in the subfigures are not printed.I receive the following warning:
"Warning: Error bars discarded (to be implemented)."

2) I am using the suplabel.m to produce super - x/y - labels for the subfigures.
Is there any way to keep the suplabels in the figure when using matlab2tikz? Right now when I insert the figures in latex the suplabels are missing.

3) A final problem I have is with keeping the legend at given position. Any suggestions?

Many thanks for any help!

05 Jul 2013 Pepijn

Pepijn (view profile)

First I really want to thank you for this wonderful package. Although I found a small error.
When I use:

a = randn(10000,1);
b = a+2;

figure; hold all;

h = findobj('-property','FaceColor');
set(h(1),'FaceColor',[1 0 0],'EdgeColor',[0.5 0 0]);
set(h(2),'FaceColor',[0 0 1],'EdgeColor',[0 0 0.5]);


matlab2tikz('test.tex','width','0.7\textwidth','showInfo', false);

If I render test.tex, the legend of Normal and Cascading will be dark red. They actually should be blue and red.

05 Jul 2013 Nico Schlömer

Nico Schlömer (view profile)

@Gregor You'll have to specify a proper format. Try '%.3g'.

Comment only
03 Jul 2013 Gregor

Gregor (view profile)

Awesome package, but I have a problem with the 'floatFormat' parameter.
If I don't set this parameter all data points get written in the resulting *.tex file - but then it is to big.
So I set the precision like that:
matlab2tikz('myfile.tex', 'floatFormat', '3' );

In the output no data points will get written, only '3's in this example.

Is this a problem or do a use this parameter in a wrong way? Thank you!
I hope you can help me.

24 May 2013 Andreas

Very great package, thanks a lot! But I have a small problem I can't fix. I need to add "mark repeat=25" as an extra parameter in the "\addplot" option list. But I cannot figure out how to do it. 'extraTikzpictureSettings' puts it before the \addplot environment. Is there a change to add an input variable fixing this problem? Thanks again!

24 May 2013 Marianne

first of all: Very Good Tutorial! Thanks for it.
I have a problem with the tikz-file and i don’t know how to fix it.
The label of my y-axis overlapes with the scale on the y-axis. The reason is that the values ​​of the scale are very small and are multiplied by 10^-3. Instead of 10^-3 is on the top (as in the x-axis), all values of the scale are multiplied with it seperately, e.g.
1 * 10^-3
8 * 10^-4
6 * 10^-4

and so the label overlapes with the first column of values. I don’t understand why is in the right form in the x-axis but not in the y-axis. In my Matlab-figure there is everything ok.
I hope i explained it understandably and somebody has a solution for this problem.

Comment only
24 May 2013 Tina

Tina (view profile)

ok, after a day searching I think I found the problem.... I've got an old version of pgfplots...

Comment only
24 May 2013 Tina

Tina (view profile)

I think I have the same problem as Arne...

For some reason I get errors including the tikz-file created with matlab2tikz to LateX (but other tikfiles). I use MATLAB R2012a, texmaker and ubuntu.

The problem seems to be within the table from the tikz file.

Some of the errors I get: (line with }; at the end of the table)
!Missing \endcsname inserted <to be read again>\protect}
!Extra \endcsname.\pgfutil@ifundefind..\ifx\csname#1\endcsname\relax \expandafter \pgfut...}
!use of newline doesn't match it's definition
!Argument of \@firstoftwo has an extra}

I'd be really thankful for help!

Comment only
18 May 2013 Axel Lødemel Holene

16 May 2013 Miche

Miche (view profile)

12 May 2013 kevin

kevin (view profile)

Error using matlab2tikz>patchcolor2xcolor (line 3523)
matlab2tikz:anycolor2rgbDon't know how to handle the color model 'interp'.

Error in matlab2tikz>getColor (line 3472)
[m2t, xcolor] = patchcolor2xcolor(m2t, color, handle);

Error in matlab2tikz>drawPatch (line 1982)
[m2t, xFaceColor] = getColor(m2t, handle, faceColor, 'patch');

Error in matlab2tikz>handleAllChildren (line 640)
[m2t, str] = drawPatch(m2t, child);

Error in matlab2tikz>drawAxes (line 829)
[m2t, childrenEnvs] = handleAllChildren(m2t, handle);

Error in matlab2tikz>saveToFile (line 487)
m2t = drawAxes(m2t, relevantAxesHandles(ix), alignmentOptions(ix));

Error in matlab2tikz (line 396)
saveToFile(m2t, fid, fileWasOpen);

Comment only
12 May 2013 kevin

kevin (view profile)

Error using matlab2tikz>handleAllChildren (line 674)
I don't know how to handle this object: light

Error in matlab2tikz>drawAxes (line 829)
[m2t, childrenEnvs] = handleAllChildren(m2t, handle);

Error in matlab2tikz>saveToFile (line 487)
m2t = drawAxes(m2t, relevantAxesHandles(ix), alignmentOptions(ix));

Error in matlab2tikz (line 396)
saveToFile(m2t, fid, fileWasOpen);

Comment only
29 Apr 2013 Pedro

Pedro (view profile)

Nico, thanks for this submission, I'm sure many people benefit from it.
I have the same problem as Etienne, below: the ordering of Matlab patches in 3D plots is not correct, and has to be fixed manually, which may not be possible for large figures.

28 Apr 2013 kevin

kevin (view profile)

Very useful. But how to keep the font name/color/size axis or title of figures?

26 Apr 2013 Arne

Arne (view profile)

I would love to use this nice script but for some reason I cannot make it work. I am using Matlab R2009b under ubuntu with Kile. Even with basic code, it does not work.

I get the following error:
[PDFLaTeX] finished with exit code 1

./testpic.tex:1005 Missing \endcsname inserted};

./testpic.tex:Extra \endcsname};

Can anyone help?

Comment only
16 Apr 2013 bersan.riccardo

02 Apr 2013 Grzegorz Knor

25 Mar 2013 Christoph

Matlab2Tikz is a great tool! Thanks a lot for sharing!
@ Nico: You did a fantastic work which helps me a lot. However, there is a minor thing you might want to change in a future release (currently unsing 0.3.2): If one is trying to convert a contour(f) plot and include the result in a tex file, one gets in trouble with the alignment. This is caused by the preamble of the resulting file, with some blank lines and the \definecolor command. In my latex distribution (miktex) every linebreak causes a small shift to the right (propably a 'blank' is interpreted) and as more colors are defined as further the figure is shifted. To avoid this behavior I added %% where the \defincolor is set up, and thus it reads: sprintf('\\definecolor{%s}{rgb}{%.15g,%.15g,%.15g}%%\n'
To get a really tight boundary box, some other lines in the preamble might need %-sign, too.
If you want me to, I can send you a simple example showing the problem.

Best regards,

24 Mar 2013 Otto Debals

22 Mar 2013 Nico Schlömer

Nico Schlömer (view profile)

@Georg I could certainly make this an option. If you could file a bug at <> and explain a little bit more about what format is needed, that'd be great.

Comment only
20 Mar 2013 Georg

Georg (view profile)

Works fantastic - I have just one little suggestion: Could you convert the RGB values of the plots to CMYK when defining the custom colors? This has proven to be necessary for correct color disply in the Adobe Reader when using pdflatex and seems to be a widely known problem

19 Mar 2013 Nico Schlömer

Nico Schlömer (view profile)

@Karthick You can use the resulting file with `latex` (generating a PS-document) as well as `pdflatex`, fonts come out just as they are in the LaTeX document, you can customize your plot after it's been generated, and probably a bunch of other reasons. All in all, when you compare MATLAB's generated PDF with the compiled output of matlab2tikz, you'll notice a distinct difference in quality.

Comment only
19 Mar 2013 Karthick

its indeed a good package. But what advantage it has from "print as pdf" option in matlab?

Comment only
18 Mar 2013 Etienne Coetzee

Dear Niko

I am trying to convert a 3d plot with many patches, but the ordering is incorrect. Some patches that should appear behind others, appear in front. I am not sure if this is a tikz problem, but was wondering if you have encountered this as well. Any help would be appreciated.

13 Mar 2013 Israel Vaughn

04 Mar 2013 Nico Schlömer

Nico Schlömer (view profile)

@H VH Ayala: Try matlab2tikz('strict', true). That should put the ticks exactly where MATLAB has them.

Comment only
24 Feb 2013 H VHA

H VHA (view profile)


How to set only pre-defined xticks on m2t?

Using the stem(.) command in MATLAB, one would only be interested to have only the values which there is data associated in the xticks.


Comment only
07 Feb 2013 Nico Schlömer

Nico Schlömer (view profile)

@Anke This is currently not possible with m2t alone, and I wouldn't even recommend it for line plots -- after all, m2t cannot tell which data is important for you and which can be stripped. I'd recommend for you to manually reduce the number of data points in your 3D plots until the TeX compilation time becomes bearable.

Comment only
06 Feb 2013 Anke

Anke (view profile)

Great tool, thanks! Only one question: how do I use the option 'minimumPointsDistance' correctly for surf plots? For normal plots, it works fine, but with surf, nothing happens...

06 Feb 2013 AP

AP (view profile)

Works flawlessly! Good job!

17 Jan 2013 Caio

Caio (view profile)

09 Jan 2013 Martijn


08 Jan 2013 Sylvain Chev

A must-have for scientific publications. Thank you very much for your effort.

12 Dec 2012 Nico Schlömer

Nico Schlömer (view profile)

@Georg If you file a bug at giving a few more details (like providing the PNGs that failed along with the MATLAB code), I can try to fix this.

Comment only
12 Dec 2012 Georg

Georg (view profile)

Works like a charm! Makes figures in latex look superb.

One little flaw though: When I overlay to axes, one containing an imge with transparency, the output is two PNGs which are all black.

05 Dec 2012 AP

AP (view profile)

Just amazing!

05 Dec 2012 AP

AP (view profile)

04 Dec 2012 nnunes

nnunes (view profile)

02 Dec 2012 Juan

Juan (view profile)

This is the best piece of matlab/latex code I have ever seen!!.

20 Nov 2012 Nico Schlömer

Nico Schlömer (view profile)

@H VH Ayala:
Do those styles allow for \usepackage{pgfplots}? That would be the only condition.
Also, by using Pgfplots' 'externalize' feature, you can convert those plots into PDFs which should be natively supported by any journal. (You may want to check out the 'standalone' option for matlab2tikz as well.)

Comment only
19 Nov 2012 H VHA

H VHA (view profile)

Is the TikZ file included in the tex file generated by the script compliant to journal submissions like Elsevier and IEEE?

Comment only
16 Nov 2012 Alessandro Magnani

06 Nov 2012 gbernardi

gbernardi (view profile)

Armin Schoisswohl's solution did the trick! ;)

Comment only
06 Nov 2012 gbernardi

gbernardi (view profile)

25 Oct 2012 Frederik Schrader

Dear Nico,

is there a way to manipulate the order of the plot elements? It doesn't seem respect it as soon as I plot data points and lines, e.g. plot(x,data,'k.',x,fit,'r-') plots the black points in the foreground, regardless of Matlab's plot order, rendering the red line practically invisible for large datasets. The same problem occurs with 'ko', while 'k-', i.e. lines for both elements, works like charm and places them in the correct order.

Thanks in advance

18 Oct 2012 Armin Schoisswohl

\text is defined in the amsmath package. Try to include '\usepackage{amsmath}' in the preamble, this should solve your problems.

Comment only
18 Oct 2012 H VHA

H VHA (view profile)

Did you try the following?

legend({'your text here'},'Interpreter','latex')

Comment only
17 Oct 2012 Nico Schlömer

Nico Schlömer (view profile)

matlab2tikz tries to be smart about how tags and labels look like, but may fail sometimes. Try setting 'parseStrings' to false.
If that doesn't help, a bug report with a small example code on would be appreciated.

Comment only
17 Oct 2012 gbernardi

gbernardi (view profile)

Great tool, but I'm experiencing problems with the legends.
What I write in the legend command in matlab is enclosed in a $\text{}$ environment and the \text{} part gives an error when compiling... Do you know why?

19 Sep 2012 leo nidas

Seriously I just saw my previous rating to your file in 2010 and I assure you that that was done by accident! I usually do not rate files, let alone give one star with no reason!This is a great tool so I hope my current rating somehow correct things. Is there a way to delete my previous rating or something?Thanx for sharing!

14 Sep 2012 Asif ARAIN

Guys, I am not able to convert an errorbar with uneven min and max values. It says that currently this code can convert only even min and max values. Any one found a solution? Thanks in advance.

Comment only
13 Sep 2012 Miche

Miche (view profile)

15 Aug 2012 Chris

Chris (view profile)

Excellent script, makes professional looking plots with ease. Thanks!

Comment only
15 Aug 2012 Chris

Chris (view profile)

14 Aug 2012 John Boissard

I had the same problem as Nicholaus Halecky. You can insert \pgfplotsset{scaled ticks=base 10:0} at the preamble of your document and it should do the trick (at least if you are using datetick).


Comment only
14 Aug 2012 John Boissard

06 Aug 2012 Alp

Alp (view profile)

15 Jun 2012 Carlos

Carlos (view profile)

24 May 2012 JoseMauricio

30 Apr 2012 Ricardo Santiago Mozos

A great tool.

23 Apr 2012 Tor Inge

10 Apr 2012 Andreas

Hi everybody,

I figured out another problem:

Somehow, matlab2tikz is not able to process >>plot3(xvector,yvector,zvector)<< files.

Even the most simple example does not work:

% ###################################################################

x = rand(100,1)*4-2;
y = rand(100,1)*4-2;
z = x.*exp(-x.^2-y.^2);

% Construct the interpolant
% F = TriScatteredInterp(x,y,z,'nearest');
% F = TriScatteredInterp(x,y,z,'natural');
F = TriScatteredInterp(x,y,z,'linear');

% Evaluate the interpolant at the locations (qx, qy), qz
% is the corresponding value at these locations.
ti = -2:.25:2;
[qx,qy] = meshgrid(ti,ti);
qz = F(qx,qy);

hold on
view(gca,[-69 14]);
hold off

matlab2tikz( 'testplot3D.tikz', 'height', '\plothoehe', 'width', '\plotbreite', 'parseStrings', false);

% ###################################################################

14 Mar 2012 Truong

Truong (view profile)

24 Feb 2012 Rhymer Yang

Compare with matlabfrag, I like matlab2tikz better. The quality of tikz output is superb! Great work! Thanks!

18 Feb 2012 Nico Schlömer

Nico Schlömer (view profile)

It does exist and is called 'minimumPointsDistance'.

Comment only
18 Feb 2012 K Prakasam

matfig2pgf code has an option to reduce the number of data points. Can u include same algorithm in ur code also!...

Comment only
17 Feb 2012 Nico Schlömer

Nico Schlömer (view profile)

Yeah I'd need the MATLAB code (e.g. by mail). That said, the warning seems to be clear: "Color bar sizes will likely need tweaking." It probably says that for a reason. ;)

Comment only
17 Feb 2012 3d plots

i have the open plot and input:

matlab2tikz( 'myfile.tikz', 'height', '10cm', 'width', '5mm' ); fine with 2D-plots.

...or is it the plot-code you're asking for?

Comment only
17 Feb 2012 Nico Schlömer

Nico Schlömer (view profile)

Example code?

Comment only
16 Feb 2012 3d plots


thanks. very useful script...generally. but i have a problem with my 3d-plots when the colorbar is displayed...i get the error message:

"Warning: Physical units of x- and y-axis do not coincide (x: mm; y: cm).Color bar sizes will
likely need tweaking."

"Error in ==> matlab2tikz>getAxisTicks at 3852
s = str2double( tickLabel{k} );"

is there any solution to this? thanks in advance.

25 Jan 2012 Dimitris K

Great work! Thanks

Comment only
16 Jan 2012 Nico Schlömer

Nico Schlömer (view profile)

Tim: Easy. Just use

>> matlab2tikz( 'myfile.tikz', 'height', '\figureheight', 'width', '\figurewidth' );

for all of your figures and set \figureheight and \figurewidth once in your LaTeX document.
See the README.

Comment only
16 Jan 2012 Tim Sønderby

Can you make so that the size of the figure always is the same, that would make it easier to control it for consistency in a report.

Thanks - great work!

27 Dec 2011 Nico Schlömer

Nico Schlömer (view profile)

There's always interest in patches to matlab2tikz! You could send a pull request on GitHub, or send the patch through by mail (use git format-patch to get properly credited) or create a pull request on GitHub. I don't mind either way.

Comment only
27 Dec 2011 Eike

Eike (view profile)

Three things:
1.: Awesome piece of code. Really saves a lot of time and work.
2.: I set the width an the hight via "\pgfplotset{}" in my preamble and just change it for a few plots. Matlab2tikz always outputs width and heigh parameters which in this case isn't very usefull.
(just found the Wiki which provides a good work around for that - "\newlength and \setlength")
3.: I added support vor the "Legend.Orientation" parameter as well as for "Loaction=SouthOutside" and "Location=NorthOutside", are you interested in the code? Where to should I send it?

Comment only
29 Nov 2011 Nico Schlömer

Nico Schlömer (view profile)

Hi Sebastien,

the #-issue should be fixed now; thanks for the report.
At the moment, I don't think pgfplots has a way of controlling the legend box aspect ratio in any way, but you may want to skim through its manual. Let me know in case you find something!

Comment only
29 Nov 2011 Sebastien PARIS

Sounds great in a first try.

One thing, if my xlabel is xlabel('# K') in matlab, the produced file is buggy (manually changed xlabel={# K} to xlabel={\# K}) in the tikz file).

How to keep the aspect ratio for legend ?

14 Nov 2011 Francesco Montorsi

very nice script!! I've been using MATLAB EPS export and then editing with Inkscape and saving as PDF+LaTex solution so far, but this one is simpler and better as it solves in an elegant way the label positioning problems of my former solution!

03 Oct 2011 THB

THB (view profile)

08 Sep 2011 Igor

Igor (view profile)

Hi Nico,
Thanks again for the great work.

Few requests:
1. Is it possible to have a command line switch to put all Matlab legend entries just in {}, instead of $$ + \text{}? My legends are mostly non-formula, so I can format them much easier if they come through matlab2tikz in this shape.

2. I propose to put "defining custom colors" section before \begin{tikzpicture} because if you make legends in the fig. caption (by using \label{} and \ref{}), LaTeX will report an error without this, since \definecolor is only scoped to tikzpicture.

3. Related to 2: Any chance of automatic labeling of plots? For example \label{filename-p1}, \label{filename-p2},....


02 Sep 2011 Michael Melzer

Hi Nico,
it might be better to use filename an path of uiputfile (line 206, 212, 218, ...), so files can be stored elsewhere than the current folder.

Thank you.

Comment only
02 Sep 2011 Michael Melzer

17 Jun 2011 Mukhtar Ullah

I have emailed you my modification to the nested function drawText in order to deal with problems in text objects created using Matlab TEXT command. If you agree with that, you could update your code accordingly and save me from modifying everytime there is a new version. Thanks.

Comment only
07 Jun 2011 Nico Schlömer

Nico Schlömer (view profile)

@Alexander Klein: I implemented one or two things, you may wanna check out the latest release.
For future changes, it's best to submit a bug report at

Comment only
19 May 2011 Nico Schlömer

Nico Schlömer (view profile)

Well, the documentation may not be up-to-date all the time.
In general it's always worthwhile to take a peek at
All the options are also listed in the source file itself of course, so you can always look at lines 125 ff. Should be pretty self-explainatory.

1) Not sure I understand what you mean.
2) You mean the image width? There are 'width' and 'height' arguments.
3) Option 'mathmode'.

Generally, if you found a bug or similar, it's easier for me to follow it up on GitHub.

Comment only
19 May 2011 Nicholaus Halecky

Thank you, Nico, the script is a work of art. I am an experienced LaTeX user (what I used to write my dissertation), and very comfortable in MatLab (minus any major plot generation). Thus, when I found your code, you can imagine how thrilled I was as I am building scripts for report generation at this time. This would be, easily, the best script I have ever encountered on this file exchange if I could find how to:
1) Remove the 10^5 in the x-axis label (I also use datetick and have added the suggestion by Mukhtar to the LaTeX preamble to no avail).
2) Predefine line width, image aspect ratio, and some sort of a scaling parameter, so that the output width and height parameters in the tikz, e.g.,


3) Some sort of understanding of how I can specify whether or not the title, axis labels, legends not be interpreted in LaTeX math mode (or do you suggest that I hard code this)?

Perhaps such features are supported (as mentioned by Petter), however a quick browse through the m file didn't give me much of a starting point.

@Alexander Klein, I am interested to know if your improvements were ever implemented by the author?

Thanks all for everything,

Comment only
02 Feb 2011 Matt Bauman

02 Jan 2011 Petter

Petter (view profile)

It was because matlab2tikz wrapped my x and ylabels with $..$. I removed that piece of code and got my expected results.

Comment only
29 Dec 2010 dm

dm (view profile)

@Petter: You have an example-code for which the spaces in xlabel doesn't work? In all my figures it works perfectly, so I assume it's something with your code.

Otherwise you don't use \includegraphics with TikZ figures (unless you pre-compile to PDF or something), but using the width/height commands already available will set the dimensions of the figure (these commands are also documented in the description here on FEX).


Comment only
28 Dec 2010 Petter

Petter (view profile)

Spaces in xlabel doesn't seem to work

Comment only
27 Dec 2010 Petter

Petter (view profile)

Seems it was already supported, but not documented.

27 Dec 2010 Petter

Petter (view profile)

Looks good, but I am missing the functionality to keep the aspect ratio and change the width. E.g., \includegraphics[width=3cm]{image}

The help does not cover the optional arguments.

22 Dec 2010 Alexander Ludwig Klein

Hi everybody!

first of all: Thank you Mr. Schlömer for matlab2tikz. This is a great piece of a software.

Unfortunately, I have had the following problems when using version 0.0.7 in Matlab 2009b on a 64bit Linux system:
1. Labels and titles could not be written by sprintf, since it where cells.
2. Barplots did not work, since there was a typo (e.g. m2t was missing)
3. I need to plot time signals with a very small difference. That is why the precision in the pgfplots coordinates were not sufficient.
4. When plotting data series with several thousand data points, it took minutes to write the file (due to strcat and a lopp for i=1:length(xData)

I have made changes to the file which takes care of this issues:
1. e.g:

if iscell(title)
title = title{:};

2. for me replacing
barplotTotalNumber = barplotTotalNumber + 1;
m2t.barplotTotalNumber = m2t.barplotTotalNumber + 1;
3. I added an option for the script where you can add a precision of the format string that is used when writing to the pgf file
4. I replaced the for loop with a repmat construction that reduced computation time a lot.

If anybody has encounters the same issues, I can send this file to Mr. Schlömer maybe (if he likes to add the changes). Or is there a better way to take care of that?

Kind regards


14 Dec 2010 dm

dm (view profile)

29 Nov 2010 Igor

Igor (view profile)

Works great!

07 Oct 2010 Mukhtar Ullah

Wondeful tool. Today, I tried it and it could be no better than that. I faced that same problem ( that annoying x10^5), as mentioned by Paul, but that has nothing to do with malab2tikz.m but the way pgfplot processes the tick labels. I found a solution, though, which I would like to share and request Nico to include it in the readme file.
Add this to your latex document preamble
\pgfplotsset{x tick label style={/pgf/number format/fixed}}
\pgfplotsset{y tick label style={/pgf/number format/fixed}}
Of course, you do not need that if you are happy with the x10^5 notation.

20 Sep 2010 Ngo Huy

Hi everybody ! My name Ngo Huy . i am studient four year of Ho Chi Minh University of industry . I have a project graduated processor image (Product Classification in (closed chain stoppers)
help me . i use PLC s7200 , matlab 7.1

Comment only
23 Jul 2010 Paul

Paul (view profile)


Amazing tool !!! Thank you very much.

I have an annoying problem though. I have coordinates imported from as matlab serial dates, which I then re-label using xtick. Works fine except when pgf plots the graph there is an annoying x10^5 in the bottom right corner (which must originate from the matlab serial date values.)

i.e., the code I have is :


scale only axis,
xmin=724642, xmax=733408,
ymin=0, ymax=3.5,

Could somebody please help me with this?

Best regards

02 Jun 2010 dm

dm (view profile)

09 Apr 2010 Craig

Craig (view profile)

Excellent Tool, plots come out looking great!

29 Jan 2010 Jean-Baptiste Carré

A really useful package. I hope it will support every plot types soon (particularly the scatter type ;-))!

10 Mar 2009 David Haberthür

I've used this submission extensively to add plots to my LaTeX-Files and it works like intended. Thanks for that submission!

10 Nov 2008 Jody Klymak

Jody Klymak (view profile)

This would be much better if you explained that one needs to upload pgf and pgfplots latex packages and call \usepackage{pgfplots} in the preamble of your LaTeX document. After that it seems to work alright.

Comment only
14 Mar 2013 1.30

update to 0.3.0

14 Mar 2013 1.33

upgrade to 0.3.2 (for real this time)

14 Apr 2013 1.34

update to 0.3.3

26 Jun 2013 1.35

update to 0.4.0

14 Aug 2013 1.36

update to 0.4.1

12 Sep 2013 1.38

update to 0.4.2

13 Sep 2013 1.40

updated logo

21 Oct 2013 1.42

update to 0.4.3

02 Jan 2014 1.43

update to 0.4.4

03 Feb 2014 1.44

update to 0.4.5

07 Feb 2014 1.45

update to 0.4.6

07 Mar 2014 1.46

update to 0.4.7

18 Aug 2015 1.47

add GitHub link

18 Aug 2015 1.48

present the contribution link more prominently

18 Aug 2015 1.49

update GitHub repository

18 Aug 2015 1.50

update description

10 Mar 2017 1.0.0

the largest update in m2t history; for details, see

Contact us