function mat2tikz_improved(filename,options) arguments % Default to the path in your example if no argument is provided filename (1,1) string = 'C:\Users\Silas\Documents\Dissertation\00_Examples\tikz\textfig.tikz'; options.cleanfigure = false; options.cleanTargetResolution = 600; options.cleanScalePrecision (1,1) double = 1; end if options.cleanfigure cleanfigure( ... 'targetResolution', options.cleanTargetResolution, ... 'scalePrecision', options.cleanScalePrecision); end matlab2tikz(char(filename), ... 'width', '\fwidth', ... 'height', '\fheight', ... 'showInfo', false, ... 'extraAxisOptions', { ... 'xlabel style={font=\color{white!15!black}\small}', ... 'ylabel style={font=\color{white!15!black}\small}', ... 'scaled ticks=false', ... 'tick label style={/pgf/number format/fixed, /pgf/number format/1000 sep={}}', ... 'every axis/.append style={font=\scriptsize}', ... 'legend columns=1', ... 'legend style={at={(0.98,0.98)}, anchor=north east, font=\scriptsize, draw=black!100, rounded corners=2pt, inner sep=1pt, fill=white, column sep=2pt}' ... }); end