Borrar filtros
Borrar filtros

Axis Values in a Figure

6 visualizaciones (últimos 30 días)
Dan
Dan el 13 de Feb. de 2013
I draw a figure using:
colormap(hot(num_colors));
image(myMatrix);
The values in the x and y axis are automatically shown in the figure. I want my values to be shown in the x,y axis.
I have two sets of custom strings xvals and yvals, how do I simply append these values to the corresponding axis in the figure?

Respuestas (1)

Eric Truslow
Eric Truslow el 13 de Feb. de 2013
To change the tick mark labels you can do something like:
set(gca,'YTickLabel',yvals);
set(gca,'XTickLabel',xvals);
where yvals and xvals are cell arrays of strings. To then change the positions of the tick marks you can use:
set(gca,'YTick',yval_num);
set(gca,'XTick',xval_num);
where xval_num and yval_num are arrays of numbers specifying the values at which to put the tick marks.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by