Beautiful plots in Latex

Quick links:
https://github.com/matlab2tikz/matlab2tikz – Matlab to TikZ (Latex graphics) conversion tool for plots
https://www.sharelatex.com/learn/TikZ_package – TikZ documentation – general graphics
https://www.sharelatex.com/learn/Pgfplots_package – Pgfplots documentation – plotting tool inside Latex

Modifications and examples below.

(Work in progress)

I modify my matlab2tikz always in two wasy:
comment out the line for the deprecated matlab version (I do the heavy work on Matlab 2012a, sue me)
before:

warning(ID, warningMessage, envWithVersion, ID);

after:

% warning(ID, warningMessage, envWithVersion, ID);

I search for default value of showInfo and change it to false
before:

ipp = ipp.addParamValue(ipp, 'showInfo', true, @islogical);

after:

ipp = ipp.addParamValue(ipp, 'showInfo', false, @islogical);

and now matlab2tikz is quiet like an electric saw stuck on a nail (and as much stable).

Next mod:
for more robust size adjustments in Latex I use a classic syntax:

matlab2tikz('plot1.tex', 'width', '\figurewidth', 'height', '\figureheight')

this of course requires figurewidth and -height to be declared in preamble and just before figure.

Ok, why now apply those as default values? I’m not really gonna use the 7.28in-like values anytime soon during my writing, so:
before:

ipp = ipp.addParamValue(ipp, 'height', '', @ischar);
ipp = ipp.addParamValue(ipp, 'width' , '', @ischar);

after:

ipp = ipp.addParamValue(ipp, 'height', '\figureheight', @ischar);
ipp = ipp.addParamValue(ipp, 'width' , '\figurewidth', @ischar);

Leave a Reply