Next: statistics, Previous: mathematical, Up: Directory Index [Contents][Index]
Converts contour matrix C returned by contour functions into a easier-to-use array struct S
[X, Y] = ndgrid(-10:10, -10:10); Z = X.^2 + Y.^2; C = contourc(Z); contourc2struct(C);
start
, opt, val, … ) ;add
) ;stop
) ;Generate a H.264/MPEG-4 AVC movie from a sequence of figures.
Requires the command ffmpeg
or avconv
to be available.
start
)basename of movie file; extension will be ".mp4"
delay between each figure, in seconds
width of movie, in pixels
height of movie, in pixels
font size of printed figure, in points (default: 10)
factor to scale line width of figure objects (default: 1)
if true, print verbose output from ffmpeg
or avconv
ezmovie("start", "opt", val, ...); plot(...); ezmovie add; plot(...); ezmovie add;
Print a figure to a file, with some common options.
width
width of printed figure, in points
aspect
aspect ratio of height to width (default: 0.75)
height
height of printed figure, in points (overrides "aspect")
dpi
resolution of printed figure, in dots per inch (default: 300)
fontsize
font size of printed figure, in points (default: 10)
linescale
factor to scale line width of figure objects (default: 1)
texregex
regular expression to apply to TeX output files
graphics_toolkit gnuplot; figname = strcat(tempname(tempdir), ".tex"); fig = figure("visible", "off"); plot(0:100, mod(0:100, 10)); ezprint(figname, "width", 100); close(fig); assert(exist(figname, "file"));
Generate colour maps where the "luma" (brightness) decreases linearly as a function of colour map index; these maps should therefore be printable in grey-scale. Light-to-dark colour maps range from white to the first colour of "name", via the second colour of "name"; dark-to-light colour maps reverse this order.
colour map
one of:
blue-cyan
, blue-magenta
, green-cyan
,
green-yellow
, red-magenta
, red-yellow
cyan-blue
, cyan-green
, magenta-blue
,
magenta-red
, yellow-green
, yellow-red
number of colour map entries
Generate a colour map by interpolating colour intensities.
colour map
m-by-2 arrays of interpolation coefficients
[x1, c1; x2, c2; ...]
where x indexes the colour map, 0<=x<=1 c is the red/gree/blue colour at x
number of colour map entries
makeColourMap([0 1;0.114 1;0.701 1;1 0.35], [0 1;0.114 1;0.701 0.35;1 0.35], [0 1;0.114 0.35;0.701 0.35;1 0.35]);
Plot contours, possibly with labels
contour array returned by contourc, etc.
S = contourc2struct(C)
{lev, prop, options…}, where:
contour level(s)
contour line properties
lbl
label this contour (true/false)
lblpos
relative position of label along contour
lbldim
size of area to clear for contour label
lblminlen
don’t label contours shorter than this
fig = figure("visible", "off"); [X, Y] = ndgrid(-10:10, -10:10); Z = X.^2 - Y.^2; lbllev = 10:10:90; C = contourc(Z, lbllev); PlotAndLabelContours(C, {"lev", lbllev, "levprop", {"color", "black"}, "lbl", true, "lbldim", [0.1, 0.1], "lblfmt", "%0.0f"}); close(fig);
Visualise a colour map.
colour map
optional colour map name
luma of colour map
plotColourMap(colormap());
A more flexible replacement for subplot()
.
range of figure coordinates in [0,1] to be covered by grid [in this dimension]
spacing between figures [in this dimension]
number of figures [in this dimension]
figure index [in this dimension]
fig = figure("visible", "off"); N = 5; M = 3; PlotGrid([0.1,0.9], [0.1,0.8], 0.05, 0.03, N, M); for i = 1:N for j = 1:M PlotGrid(i, j); text(0.5,0.5,sprintf("%g,%g",i,j)); endfor endfor close(fig);
Try to generate a given number of ticks on a given axis.
one of x
, y
, z
number of ticks to try to generate
fig = figure("visible", "off"); plot(0:100, mod(0:100, 10)); SetTickMarks("x", 4); SetTickMarks("y", 4); close(fig);
Next: statistics, Previous: mathematical, Up: Directory Index [Contents][Index]