This is a repository containing scripts for plotting nice MATLAB plots.
- This code plots the log-law using the Matlab script
plot2D.m
. - There are two plotting options to create publication-quality figures:
- Option 1 renders the text in latex font and can be directly inserted into manuscripts. Quite good control.
- Option 2 renders placeholders for text and enables
psfrag
. Even more control, but very finicky.
- I will describe option 1 only, since I found this much more user-friendly.
- Run the Matlab code and save the plots
uavg_raw_bg.png
anduavg_raw.pdf
to figs. - In the folder
/figs-publication
, compileuavg.tex
usingpdflatex
. - In the same folder, execute
pdfcrop uavg.pdf
in terminal to trim the bounding boxes.
- Run the Matlab code and save the plots
- By default, Matlab renders a square linecap style in the eps figure. You can change this to make it more appealing!
- Open the eps file in a text editor (e.g.
vi
). Then, look for the line corresponding to thesetlinecap
, and change the value from 0 to 1. - For example, in
figs/uavg_raw.eps
, thesetlinecap
is defined as/J
. You can find this on line 435 as0 J
. Changing it to1 J
will produce a rounded linecap.