I have a matlab code, creating a set of figures, which I want to export to Latex using matlab2tikz. Unfortunately I can't figure out how to export without a legend, using Matlab R2019b and matlab2tikz

I could remove the legendentries manually in the .tex files, however I have very many files and wanted to have a toolchain, which works fully automated.

Here is a simple example

hold on;
hold off

Stopping the code before the matlab2tikz export, the plot does not have a legend. Unfortunately, it is added with the matlab2tikz command. Can anybody help?

Edit: Thanks Torbjørn, the bug report lists a solution, however, settings like 'NumColumns',3 seem not be supported. May this result in the change or is there another trick?


1 Answer 1


I put the following code:

fleg = legend('figure()');


Which works for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .