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.
Axes Limits, Scale, and Aspect Ratio
|Set or query x-axis scale (linear or logarithmic) (Since R2023b)
|Set or query y-axis scale (linear or logarithmic) (Since R2023b)
|Set or query z-axis scale (linear or logarithmic) (Since R2023b)
Plot Box and Aspect Ratio
Ticks, Grid Lines, and Labels
|Set or query x-axis tick values
|Set or query y-axis tick values
|Set or query z-axis tick values
|Specify x-axis tick label format
|Specify y-axis tick label format
|Specify z-axis tick label format
|Date formatted tick labels
|Convert data from specific ruler to numeric data
|Convert numeric data for use with specific ruler
Grid Lines and Tick Marks
|Display or hide axes grid lines
|Rotate x-axis tick labels
|Rotate y-axis tick labels
|Rotate z-axis tick labels
Multiple Plots and Data Series
|Retain current plot when adding new plots
|Create chart with two y-axes
|Add legend to axes
Coloring Multiple Data Series
|Set or query color order palette (Since R2019b)
|Color palettes for visualizing multiple data series (Since R2023b)
Limits, Ticks, and Grids
- Specify Axis Limits
Control where data appears in the axes by setting the axis limits.
- Specify Axis Tick Values and Labels
Customize the tick values and labels along an axis, such as editing the tick value placement or modifying the tick label text and formatting.
- Add Grid Lines and Edit Placement
Add grid lines to a graph and modify their placement and appearance.
- Using Graphics Smoothing
This example shows how to use graphics and font smoothing in your plots.
- Combine Multiple Plots
Show multiple plots together in the same figure, either by combining the plots in the same axes or by creating a tiled chart layout.
- Create Chart with Two y-Axes
Create a chart with y-axes on both the left and right sides.
- Modify Properties of Charts with Two y-Axes
Modify charts with two y-axes by setting axes properties or by accessing the underlying ruler objects.
- Display Data with Multiple Scales and Axes Limits
Learn about techniques for visualizing data with multiple x- and y-axes, multiple colorbars, or with an x-axis that is broken into intervals.
- Customized Presentations and Special Effects with Tiled Chart Layouts
Explore the different ways you can use a tiled chart layout to arrange the elements in a visualization.
Size and Aspect Ratio
- Control Ratio of Axis Lengths and Data Unit Lengths
Control the axis and data unit lengths by setting the plot box aspect ratio and the data aspect ratio.
- Control Axes Layout
Control the axes size and position, the layout of titles and labels, and the axes resize behavior.
- Clipping in Plots and Graphs
This example shows how MATLAB® uses clipping in plots and how to control clipping.