Preparing Figures in Matlab and LaTeX for Quality Publications Preparing Figures in Matlab and LATEX for Quality Publications Azad Ghaffari Cymer Center for Control Systems and Dynamics UC San Diego S.
Trang 1Preparing Figures in Matlab and LATEX for Quality
Publications
Azad Ghaffari
Cymer Center for Control Systems and Dynamics - UC San Diego
Second Edition, January 2014
Trang 2Image formats: Vector vs Raster
Raster graphics or bitmap
Vector graphics or line art
Trang 3Figures in Matlab
manipulating and displaying graphics
display graphs and GUI components
◮ Unique identifier, called a handle
◮ Set of characteristics, called properties
Core Objects Plot Objects Group Objects Annotation Objects
Figure Root
Trang 4Avoid common mistakes
Don’t
Do
Trang 5plot function
Calling the plot function creates graphics objects:
function
Main functions for working with objects
Trang 6Sinusoidal function
y=sin(t)
\includegraphics[width=2.5in]{sin1}
Problems:
Trang 7Figure size
What is the size of your presentation?
For a beamer slide: width=5.04 in, length=3.78 inWhat is the desired figure size?
Trang 11Labels and legend
Labels can have different font sizes
Trang 12Labels, legend, and LATEX commands
Trang 13Labels and legend
Mathematical writing is corrected
Figure has large white boundaries
Fonts are not proportional to the values we want
y = sin(t)
Trang 14How to save the plot
Don’t export the plot to eps
Use print command to generate eps filesprint -depsc2 myplot.eps
Main vector formats
Trang 15Exported eps vs printed eps
Exported eps
-1.5 -1 -0.5 0 0.5 1 1.5 2
-1 -0.5 0 0.5 1 1.5 2
Time(s) Sinusoidal function
y = sin(t)
Trang 16Inserting eps in LATEX
look of the eps file
y(
Time(s) Sinusoidal function
Trang 17(Γ22) −1
0 20 40 60 80 100 120 140 160 180 200 -40
Trang 18Ex 2
65 70 75 80 85 90 95
Trang 190 10 20 30 40 50 0
80 160 240 (d)
1000 W/m 2
800 W/m 2
600 W/m 2
400 W/m 2
Trang 21Voltage(V)
Trang 22Ex 6
20 40 60 80 100 120 140 160
Trang 24Ex 8
0 50 100 150 200
Trang 25Export Simulink models (Not for publication)
orient(gcs, ’portrait’)
print -deps -r300 -s myfig.eps
Trang 26Export Simulink models (Not for publication)
yn(t)
Interpreted MATLAB Fcn
yg(t)
Interpreted MATLAB Fcn
y_n y_g
inv
Interpreted MATLAB Fcn h_theta_n
Sn(t) Interpreted
MATLAB Fcn
Sg(t) Interpreted
MATLAB Fcn
Riccati Sigma Gamma
Matrix Multiply
Interpreted MATLAB Fcn
Mn(t)
Interpreted MATLAB Fcn
Mg(t)
Interpreted MATLAB Fcn K_g K*u
1
1
High pass1 s s+omega_h
High pass s s+omega_h
H
Filter3 Fin Fout Filter2 Fin Fout
Filter1 Fin Fout
-K_n K*u
Trang 27Diagrams in LATEX– Picture environment
Trang 28Diagrams in LATEX– LATEXCAD package
s s+ω h
Trang 29Diagrams in LATEX– LATEXCAD package
PV21
PV12 PV1n
PV2n
PVmn+
Trang 30Diagrams in LATEX– LATEXCAD package
PV21
PV12 PV1n
PV2n
PVmn+
Trang 31Diagrams in LATEX– TikZ and PGF packages
PV1
V1 Converter
D1
Vo1 Io1
PV2
V2 Converter
D2
Vo2 Io2
PVn
Vn Converter
Von Ion
Trang 32Diagrams in LATEX– TikZ and PGF packages
× Low-pass filter
M (t)
S(t)
K s
N (t)
× Low-pass filter
ˆ H
Trang 33Diagrams in LATEX– TikZ and PGF packages
Trang 34Electrical circuits in LATEX– CrcuitTikZ package
C ′ 1
Trang 35How to convert LATEX-produced figures into eps
dvips -E figure.dvi -o figure.eps
and upper-right (Bx, By) coordinates
BoundingBox area on the output
Trang 36Richard E Turner, Umesh Rajashekar
Publication quality figures using Matlab,