Docs/Data Visualization

Data Visualization

M-Code-style plotting functions for inline Chart.js visualizations.

plot
2-D line plot
plot(y)
loglog
Log-log scale plot
loglog(y)
semilogx
Semi-logarithmic plot (log x-axis)
semilogx(y)
semilogy
Semi-logarithmic plot (log y-axis)
semilogy(y)
bar
Bar chart
bar(y)
scatter
Scatter plot
scatter(x, y)
spy
Visualize sparsity pattern
spy(S)
quiver
2-D quiver (velocity) plot
quiver(U, V)
fill
Filled 2-D polygon
fill(X, Y)
histogram
Histogram
histogram(data)
pie
Pie chart
pie(data)
title
Add title to current chart
title(str)
xlabel
Label x-axis
xlabel(str)
ylabel
Label y-axis
ylabel(str)
legend
Add legend to current chart
legend('label1', 'label2', ...)
figure
Create a new figure
figure
xlim
Set x-axis limits
xlim([min max])
ylim
Set y-axis limits
ylim([min max])
xticks
Set x-axis tick values
xticks(values)
yticks
Set y-axis tick values
yticks(values)
xtickangle
Rotate x-axis tick labels
xtickangle(angle)
ytickangle
Rotate y-axis tick labels
ytickangle(angle)
grid
Toggle grid lines
grid
axis
Set axis limits and scaling
axis([xmin xmax ymin ymax])
hold
Hold current plot
hold
gcf
Get current figure
f = gcf
gca
Get current axes
ax = gca
clf
Clear current figure
clf
close
Close figure
close
text
Add text annotation
text(x, y, str)
yyaxis
Control dual y-axes
yyaxis('left')
subplot
Create subplot grid
subplot(rows, cols, index)
mesh
3-D wireframe mesh surface
mesh(Z)
surf
3-D shaded surface plot
surf(Z)
zlabel
Label z-axis
zlabel(str)
view
Set 3D view angle
view(az, el)
imagesc
Display matrix as scaled image
imagesc(C)
colorbar
Add colorbar to current chart
colorbar
colormap
Set or get colormap for current figure
colormap(name)
shading
Set surface shading mode
shading faceted