0

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 1.0.0.0.

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

figure()
hold on;
plot(sin(0:.01:pi));
hold off
matlab2tikz('test.tex');

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?

2

1 Answer 1

1

I put the following code:

fleg = legend('figure()');
set(fleg,'visible','off')

matlab2tikz('test.tex')

Which works for me.

You must log in to answer this question.

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