Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

Axes Appearance

Modify axis limits and tick values, add grid lines, combine multiple plots

You can customize axes by changing the limits, controlling the locations of the tick marks, formatting the tick labels, or adding grid lines. You also can combine multiple plots, either using separate axes in the same figure, or by combining the plots in the same axes, with the option to add a second y-axis.

Functions

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

Properties

Axes Properties Control axes appearance and behavior

Examples and How To

Change Axis Limits of Graph

This example shows how to change the axis limits of a graph.

Specify Axis Tick Values and Labels

Customizing the tick labels along the x-axis and y-axis can help highlight particular aspects of your data.

Display Axis Lines Through Origin

This example shows how to create a plot and display the x-axis and y-axis lines so that they cross at the origin point (0,0).

Add Plot to Existing Graph

This example shows how to add a plot to an existing graph.

Display Grid Lines on 2-D Graph

This example shows how to add major and minor grid lines to a graph and how to change the grid line style.

Create Figure with Multiple Axes Using Subplots

This example shows how to create a figure containing multiple axes using the subplot function.

Create Chart with Two y-Axes

This example shows how to create a chart with y-axes on the left and right sides using the yyaxis function.

Set Properties for Chart with Two y-Axes

The yyaxis command creates an axes object with y-axes on the left and right sides.

Specify Colors for Chart with Two y-Axes

The yyaxis command creates an axes object with y-axes on the left and right sides.

Graph with Multiple x-Axes and y-Axes

This example shows how to create a graph using the bottom and left sides of the axes for the first plot, and the top and right sides of the axes for the second plot.

Concepts

Axes Aspect Ratio

Set the aspect ratio with the axis function.

Automatically Calculated Properties

When plotting functions create graphs, many of the axes properties that are under automatic control adjust to best display the graph.

Axes Resize to Accommodate Titles and Labels

You can control which dimensions axes can change to accommodate the titles and labels by setting the appropriate properties.

Was this topic helpful?