tomlankhorst / comments

utterances 🔮
0 stars 0 forks source link

matlab-to-latex-with-matlab2tikz/ #6

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Matlab2Tikz: Perfect MATLAB Figures in LaTeX | Tom Lankhorst

Papers and reports can’t do without both but integrating MATLAB figures in LaTeX is not so obvious. Different methods for exporting and including graphics exist but have various downsides like inconsistent scaling, wrong fonts and strange spacing. The best method I have come across so far is using matlab2tikz. It is a MATLAB script that is able to extract all relevant details out of a figure and convert it to PGFPlots (a LaTeX package).

https://tomlankhorst.nl/matlab-to-latex-with-matlab2tikz/

tomlankhorst commented 3 years ago

Original author: zlj
Original date: 2017-03-22T16:14:06Z

Thanks very much for this great explanation. How would you modify the code to implement it in a two column latex document using multicols? I'm a total noob; apologies in advance!

tomlankhorst commented 3 years ago

Original date: 2017-03-22T16:40:19Z

A two-column document is not really related to plotting with tikz ;). Take a look at this for examples on how to create columns https://www.sharelatex.com/... . Then, put the 'figure' code in it and use \setlength\fwidth{1.0\linewidth} to set the width of the figure to the width of the line.

tomlankhorst commented 3 years ago

Original author: Juan D. Pulgarín R. @juandpulgarnr
Original date: 2018-02-16T14:58:34Z

This is great! Thank you very much.

tomlankhorst commented 3 years ago

Original author: Jos M
Original date: 2018-07-04T19:32:50Z

Thanks, a very clear explanation. I have some problem though with some plots with the x-axis labels being in datetime. It seems that this causes an error with matlab2tikz. Could this be right and is there a fix?

tomlankhorst commented 3 years ago

Original author: None
Original date: 2018-08-15T06:09:23Z

None

tomlankhorst commented 3 years ago

Original author: marai
Original date: 2020-10-27T11:57:05Z

Hi, thank you very much! I tried the Matlab2Tikz but, in the generated .tex, I do not see the horizontal and vertical lines that I created with xline and yline. Any suggestions?

tomlankhorst commented 3 years ago

Original author: Hercules Mythos @herculesmythos
Original date: 2020-11-16T14:32:34Z

I have a problem with a plot. I convert it to a .tex file and when I compile it, the resolution of the plot is a mess. How can I fix it? https://uploads.disquscdn.c... https://uploads.disquscdn.c...