This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Customizing Tick Labels

You can use graphics functions in MATLAB to modify tick labels on Cartesian and polar plots.

Tick Labels in Cartesian Coordinates

Modify the tick labels of a Cartesian plot to better display the data. Create a plot that shows monthly temperature data over the course of a decade. Load the file monthlyTemps.mat, which contains the variables temperatures, months, and years. Visualize the yearly and monthly changes in a three-dimensional bar graph.


axis([0 13 0 12 0 80])

title('Monthly Temperatures 1990-2000')

The plot has the numbers 1 through 11 for the Year axis and the numbers 1 through 12 for the Month axis.

Customizing Tick Labels for X, Y, and Z

Adjust the tick label properties to better display the information. Define tick labels by passing cell arrays of character vectors to the xticklabels and yticklabels functions.


Angle the labels so that the text does not overlap. To adjust the angle of the tick labels, use the xtickangle and ytickangle functions.


The tick formatting functions change tick labels to fit a certain format, such as percentages or a type of currency. To add the degree symbol along the temperature axis labels, use the ztickformat function.


Tick Labels in Polar Coordinates

Similar to a Cartesian plot, you can modify the tick labels of a polar plot to better display the data.

Create a plot that shows wind velocity data. Load the file windData.mat, which includes the variables direction, speed, humidity, C, and cardinal. Visualize the data on a polar scatter plot.


Customizing Tick Labels for R and Theta

Adjust the radial tick labels with the r-axis tick label functions, such as rticks and rtickformat.

rticks([10 20])

Change the theta tick labels with the theta-axis tick label functions, such as thetaticks and thetaticklabels.


Was this topic helpful?