Julia for MATLAB Users/Core Language/Graphics

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Graphics

[edit | edit source]

See Introducing Julia/Plotting for an overview of the plotting ecosystem in Julia.

2-D and 3-D Plots

[edit | edit source]

Line Plots

[edit | edit source]
plot 2-D line plot
[edit | edit source]
plot3 3-D line plot
[edit | edit source]
loglog Log-log scale plot
[edit | edit source]
semilogx Semilogarithmic plot
[edit | edit source]
semilogy Semilogarithmic plot
[edit | edit source]
errorbar Line plot with error bars
[edit | edit source]
fplot Plot expression or function
[edit | edit source]
fplot3 3-D parametric curve plotter
[edit | edit source]
fimplicit Plot implicit function
[edit | edit source]
LineSpec Line specification
[edit | edit source]
ColorSpec Color specification
[edit | edit source]

Pie Charts, Bar Plots, and Histograms

[edit | edit source]
bar Bar graph
[edit | edit source]
bar3 Plot 3-D bar graph
[edit | edit source]
barh Plot bar graph horizontally
[edit | edit source]
bar3h Plot horizontal 3-D bar graph
[edit | edit source]
histogram Histogram plot
[edit | edit source]
histogram2 Bivariate histogram plot
[edit | edit source]
morebins Increase number of histogram bins
[edit | edit source]
fewerbins Decrease number of histogram bins
[edit | edit source]
histcounts Histogram bin counts
[edit | edit source]
histcounts2 Bivariate histogram bin counts
[edit | edit source]
binscatter Binned scatter plot
[edit | edit source]
rose Angle histogram plot
[edit | edit source]
pareto Pareto chart
[edit | edit source]
area Filled area 2-D plot
[edit | edit source]
pie Pie chart
[edit | edit source]
pie3 3-D pie chart
[edit | edit source]

Discrete Data Plots

[edit | edit source]
stem Plot discrete sequence data
[edit | edit source]
stairs Stairstep graph
[edit | edit source]
stem3 Plot 3-D discrete sequence data
[edit | edit source]
scatter Scatter plot
[edit | edit source]
scatter3 3-D scatter plot
[edit | edit source]
spy Visualize sparsity pattern
[edit | edit source]
plotmatrix Scatter plot matrix
[edit | edit source]
heatmap Create heatmap chart
[edit | edit source]
sortx Sort elements in heatmap row
[edit | edit source]
sorty Sort elements in heatmap column
[edit | edit source]
wordcloud Create word cloud chart from text data
[edit | edit source]
geobubble Visualize data values at specific geographic locations
[edit | edit source]
geolimits Set or query geographic limits
[edit | edit source]

Polar Plots

[edit | edit source]
polarplot Plot line in polar coordinates
[edit | edit source]
polarscatter Scatter chart in polar coordinates
[edit | edit source]
polarhistogram Histogram chart in polar coordinates
[edit | edit source]
compass Plot arrows emanating from origin
[edit | edit source]
ezpolar Easy-to-use polar coordinate plotter
[edit | edit source]
rlim Set or query r-axis limits for polar axes
[edit | edit source]
thetalim Set or query theta-axis limits for polar axes
[edit | edit source]
rticks Set or query r-axis tick values
[edit | edit source]
thetaticks Set or query theta-axis tick values
[edit | edit source]
rticklabels Set or query r-axis tick labels
[edit | edit source]
thetaticklabels Set or query theta-axis tick labels
[edit | edit source]
rtickformat Specify r-axis tick label format
[edit | edit source]
thetatickformat Specify theta-axis tick label format
[edit | edit source]
rtickangle Rotate r-axis tick labels
[edit | edit source]
polaraxes Create polar axes
[edit | edit source]

Contour Plots

[edit | edit source]
contour Contour plot of matrix
[edit | edit source]
contourf Filled 2-D contour plot
[edit | edit source]
contourc Low-level contour plot computation
[edit | edit source]
contour3 3-D contour plot
[edit | edit source]
contourslice Draw contours in volume slice planes
[edit | edit source]
clabel Label contour plot elevation
[edit | edit source]
fcontour Plot contours
[edit | edit source]

Vector Fields

[edit | edit source]
feather Plot velocity vectors
[edit | edit source]
quiver Quiver or velocity plot
[edit | edit source]
compass Plot arrows emanating from origin
[edit | edit source]
quiver3 3-D quiver or velocity plot
[edit | edit source]
streamslice Plot streamlines in slice planes
[edit | edit source]
streamline Plot streamlines from 2-D or 3-D vector data
[edit | edit source]

Surfaces, Volumes, and Polygons

[edit | edit source]

Surface and Mesh Plots

[edit | edit source]
surf Surface plot
[edit | edit source]
surfc Contour plot under a 3-D shaded surface plot
[edit | edit source]
surface Create surface object
[edit | edit source]
surfl Surface plot with colormap-based lighting
[edit | edit source]
surfnorm Compute and display 3-D surface normals
[edit | edit source]
mesh Mesh plot
[edit | edit source]
meshc Plot a contour graph under mesh graph
[edit | edit source]
meshz Plot a curtain around mesh plot
[edit | edit source]
hidden Remove hidden lines from mesh plot
[edit | edit source]
fsurf Plot 3-D surface
[edit | edit source]
fmesh Plot 3-D mesh
[edit | edit source]
fimplicit3 Plot 3-D implicit function
[edit | edit source]
waterfall Waterfall plot
[edit | edit source]
ribbon Ribbon plot
[edit | edit source]
contour3 3-D contour plot
[edit | edit source]
peaks Example function of two variables
[edit | edit source]
cylinder Generate cylinder
[edit | edit source]
ellipsoid Generate ellipsoid
[edit | edit source]
sphere Generate sphere
[edit | edit source]
pcolor Pseudocolor (checkerboard) plot
[edit | edit source]
surf2patch Convert surface data to patch data
[edit | edit source]

Volume Visualization

[edit | edit source]
contourslice Draw contours in volume slice planes
[edit | edit source]
flow Simple function of three variables
[edit | edit source]
isocaps Compute isosurface end-cap geometry
[edit | edit source]
isocolors Calculate isosurface and patch colors
[edit | edit source]
isonormals Compute normals of isosurface vertices
[edit | edit source]
isosurface Extract isosurface data from volume data
[edit | edit source]
reducepatch Reduce number of patch faces
[edit | edit source]
reducevolume Reduce number of elements in volume data set
[edit | edit source]
shrinkfaces Reduce size of patch faces
[edit | edit source]
slice Volume slice planes
[edit | edit source]
smooth3 Smooth 3-D data
[edit | edit source]
subvolume Extract subset of volume data set
[edit | edit source]
volumebounds Coordinate and color limits for volume data
[edit | edit source]
coneplot Plot velocity vectors as cones in 3-D vector field
[edit | edit source]
curl Compute curl and angular velocity of vector field
[edit | edit source]
divergence Compute divergence of vector field
[edit | edit source]
interpstreamspeed Interpolate stream-line vertices from flow speed
[edit | edit source]
stream2 Compute 2-D streamline data
[edit | edit source]
stream3 Compute 3-D streamline data
[edit | edit source]
streamline Plot streamlines from 2-D or 3-D vector data
[edit | edit source]
streamparticles Plot stream particles
[edit | edit source]
streamribbon 3-D stream ribbon plot from vector volume data
[edit | edit source]
streamslice Plot streamlines in slice planes
[edit | edit source]
streamtube Create 3-D stream tube plot
[edit | edit source]

Polygons

[edit | edit source]
fill Filled 2-D polygons
[edit | edit source]
fill3 Filled 3-D polygons
[edit | edit source]
patch Create one or more filled polygons
[edit | edit source]
surf2patch Convert surface data to patch data
[edit | edit source]

Animation

[edit | edit source]
movie Play recorded movie frames
[edit | edit source]
getframe Capture axes or figure as movie frame
[edit | edit source]
frame2im Return image data associated with movie frame
[edit | edit source]
im2frame Convert image to movie frame
[edit | edit source]
animatedline Create animated line
[edit | edit source]
addpoints Add points to animated line
[edit | edit source]
getpoints Return points that define animated line
[edit | edit source]
clearpoints Clear points from animated line
[edit | edit source]
comet 2-D comet plot
[edit | edit source]
comet3 3-D comet plot
[edit | edit source]
drawnow Update figures and process callbacks
[edit | edit source]
refreshdata Refresh data in graph when data source is specified
[edit | edit source]

Formatting and Annotation

[edit | edit source]

Titles and Labels

[edit | edit source]
title Add title
[edit | edit source]
xlabel Label x-axis
[edit | edit source]
ylabel Label y-axis
[edit | edit source]
zlabel Label z-axis
[edit | edit source]
clabel Label contour plot elevation
[edit | edit source]
legend Add legend to axes
[edit | edit source]
colorbar Colorbar showing color scale
[edit | edit source]
text Add text descriptions to data points
[edit | edit source]
texlabel Format text with TeX characters
[edit | edit source]
gtext Add text to figure using mouse
[edit | edit source]
line Create primitive line
[edit | edit source]
rectangle Create rectangle with sharp or curved corners
[edit | edit source]
annotation Create annotations
[edit | edit source]

Axes Appearance

[edit | edit source]
xlim Set or query x-axis limits
[edit | edit source]
ylim Set or query y-axis limits
[edit | edit source]
zlim Set or query z-axis limits
[edit | edit source]
axis Set axis limits and aspect ratios
[edit | edit source]
box Display axes outline
[edit | edit source]
daspect Control data unit length along each axis
[edit | edit source]
pbaspect Control relative lengths of each axis
[edit | edit source]
grid Display or hide axes grid lines
[edit | edit source]
xticks Set or query x-axis tick values
[edit | edit source]
yticks Set or query y-axis tick values
[edit | edit source]
zticks Set or query z-axis tick values
[edit | edit source]
xticklabels Set or query x-axis tick labels
[edit | edit source]
yticklabels Set or query y-axis tick labels
[edit | edit source]
zticklabels Set or query z-axis tick labels
[edit | edit source]
xtickformat Specify x-axis tick label format
[edit | edit source]
ytickformat Specify y-axis tick label format
[edit | edit source]
ztickformat Specify z-axis tick label format
[edit | edit source]
xtickangle Rotate x-axis tick labels
[edit | edit source]
ytickangle Rotate y-axis tick labels
[edit | edit source]
ztickangle Rotate z-axis tick labels
[edit | edit source]
datetick Date formatted tick labels
[edit | edit source]
ruler2num Convert data from specific ruler to numeric data
[edit | edit source]
num2ruler Convert numeric data for use with specific ruler
[edit | edit source]
hold Retain current plot when adding new plots
[edit | edit source]
subplot Create axes in tiled positions
[edit | edit source]
yyaxis Create chart with two y-axes
[edit | edit source]
cla Clear axes
[edit | edit source]
axes Create Cartesian axes
[edit | edit source]
figure Create figure window
[edit | edit source]

Colormaps

[edit | edit source]
colormap View and set current colormap
[edit | edit source]
colorbar Colorbar showing color scale
[edit | edit source]
rgbplot Plot colormap
[edit | edit source]
Colormap Editor Open colormap editor
[edit | edit source]
brighten Brighten or darken colormap
[edit | edit source]
contrast Create grayscale colormap to enhance image contrast
[edit | edit source]
caxis Set colormap limits
[edit | edit source]
spinmap Rotate colormap colors
[edit | edit source]
hsv2rgb Convert HSV colors to RGB
[edit | edit source]
rgb2hsv Convert RGB colors to HSV
[edit | edit source]
parula Parula colormap array
[edit | edit source]
jet Jet colormap array
[edit | edit source]
hsv HSV colormap array
[edit | edit source]
hot Hot colormap array
[edit | edit source]
cool Cool colormap array
[edit | edit source]
spring Spring colormap array
[edit | edit source]
summer Summer colormap array
[edit | edit source]
autumn Autumn colormap array
[edit | edit source]
winter Winter colormap array
[edit | edit source]
gray Gray colormap array
[edit | edit source]
bone Bone colormap array
[edit | edit source]
copper Copper colormap array
[edit | edit source]
pink Pink colormap array
[edit | edit source]
lines Lines colormap array
[edit | edit source]
colorcube Colorcube colormap array
[edit | edit source]
prism Prism colormap array
[edit | edit source]
flag Flag colormap array
[edit | edit source]

3-D Scene Control

[edit | edit source]

Camera Views

[edit | edit source]
view Viewpoint specification
[edit | edit source]
makehgtform Create 4-by-4 transform matrix
[edit | edit source]
viewmtx View transformation matrices
[edit | edit source]
cameratoolbar Control camera toolbar programmatically
[edit | edit source]
campan Rotate camera target around camera position
[edit | edit source]
camzoom Zoom in and out on scene
[edit | edit source]
camdolly Move camera position and target
[edit | edit source]
camlookat Position camera to view object or group of objects
[edit | edit source]
camorbit Rotate camera position around camera target
[edit | edit source]
campos Set or query camera position
[edit | edit source]
camproj Set or query projection type
[edit | edit source]
camroll Rotate camera about view axis
[edit | edit source]
camtarget Set or query location of camera target
[edit | edit source]
camup Set or query camera up vector
[edit | edit source]
camva Set or query camera view angle
[edit | edit source]

Lighting, Transparency, and Shading

[edit | edit source]
camlight Create or move light object in camera coordinates
[edit | edit source]
light Create light
[edit | edit source]
lightangle Create or position light object in spherical coordinates
[edit | edit source]
lighting Specify lighting algorithm
[edit | edit source]
shading Set color shading properties
[edit | edit source]
diffuse Calculate diffuse reflectance
[edit | edit source]
material Control reflectance properties of surfaces and patches
[edit | edit source]
specular Calculate specular reflectance
[edit | edit source]
alim Set or query axes alpha limits
[edit | edit source]
alpha Add transparency to objects in axes
[edit | edit source]
alphamap Specify figure alphamap (transparency)
[edit | edit source]

Images

[edit | edit source]
imshow Display image
[edit | edit source]
image Display image from array
[edit | edit source]
imagesc Display image with scaled colors
[edit | edit source]
imread Read image from graphics file
[edit | edit source]
imresize Resize image
[edit | edit source]
imwrite Write image to graphics file
[edit | edit source]
imfinfo Information about graphics file
[edit | edit source]
imformats Manage image file format registry
[edit | edit source]
frame2im Return image data associated with movie frame
[edit | edit source]
im2frame Convert image to movie frame
[edit | edit source]
im2java Convert image to Java image
[edit | edit source]
im2double Convert image to double precision
[edit | edit source]
ind2rgb Convert indexed image to RGB image
[edit | edit source]
rgb2gray Convert RGB image or colormap to grayscale
[edit | edit source]
rgb2ind Convert RGB image to indexed image
[edit | edit source]
imapprox Approximate indexed image by reducing number of colors
[edit | edit source]
dither Convert image, increasing apparent color resolution by dithering
[edit | edit source]
cmpermute Rearrange colors in colormap
[edit | edit source]