Borrar filtros
Borrar filtros

How to add a favorite vector as labels for plot() function?

3 visualizaciones (últimos 30 días)
Ali Rezaei
Ali Rezaei el 22 de Mzo. de 2012
How to add a favorite vector as labels for plot() function? For instance I need to display vector [1 2.2 3.14] as x axes labels instead [1 2 3].

Respuestas (1)

Geoff
Geoff el 22 de Mzo. de 2012
set(gca,'XTick',[1 2.2 3.14]);
  1 comentario
Geoff
Geoff el 22 de Mzo. de 2012
Or use 'XTickLabel' if you indeed just want to rename the values [1 2 3]

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by