Rank: 67 based on 872 downloads (last 30 days) and 2 files submitted
photo

Nico Schlömer

E-mail
Company/University
Universiteit Antwerpen

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Nico View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 Apr 2014 Screenshot matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer latex, figure, embed, bug, toolbox 790 116
  • 4.87209
4.9 | 96 ratings
06 Nov 2013 Screenshot Guidelines for writing clean and fast code in MATLAB This document gives hints on how to write fast and good quality MATLAB code. Author: Nico Schlömer documentation, article 82 4
  • 5.0
5.0 | 6 ratings
Comments and Ratings by Nico View all
Updated File Comments Rating
07 Feb 2014 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer

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

05 Nov 2013 Guidelines for writing clean and fast code in MATLAB This document gives hints on how to write fast and good quality MATLAB code. Author: Nico Schlömer

@Mark Mikofski Definitely a good idea to add this.

02 Nov 2013 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer

@Anfänger Sounds like a bug. If you want it fixed, file a report at <https://github.com/nschloe/matlab2tikz/issues?state=open> with a minimal MATLAB example that highlights the misbehavior.

28 Oct 2013 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer

@lyxicon

1. There is the option 'extraAxisOptions'. If that doesn't work for you, you could file a bug at <https://github.com/nschloe/matlab2tikz/issues?state=open>.

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.

14 Aug 2013 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer

@Maria Filing your problems at https://github.com/nschloe/matlab2tikz/issues?state=open with some minimal example code that highlights what goes wrong would make it much easier to fix the issues.

Comments and Ratings on Nico's Files View all
Updated File Comment by Comments Rating
16 Jul 2014 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer Georg

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?

01 Jul 2014 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer Simone

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

24 Jun 2014 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer Nico

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:
--header--
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pgfplotsset{plot coordinates/math parser=false}
\usetikzlibrary{plotmarks}
---after \begin{document}---
\begin{figure}
\input{m2ttest.tex}
\caption{TIKZ Test}
\end{figure}
----------------

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
713c713
< sprintf('\\addlegendentry{%s};\n\n', join(m2t, c, '\\'))]; %#ok
---
> sprintf('\\addlegendentry[align=left]{%s};\n\n', join(m2t, c, '\\'))]; %#ok
3646c3646,3651
< 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);
4840c4845,4848
<
---
> %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 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer Saliou

@Kine
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}'};

matlab2tikz('mypicture.tex','extraAxisOptions',axoptions);

15 Jun 2014 matlab2tikz A script to convert MATLAB/Octave into TikZ figures for easy and consistent inclusion into LaTeX. Author: Nico Schlömer NGUYEN

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!

Contact us