Hi. How to change the order of x axis in the plot function? Instead of 1 , 2 , 3... i would the axis to plot for 0.2, 0.4,...,0.9 , 1, 0.9,...,0.4, 0.2. ?
Thank a lot.

 Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 28 Mar 2016
%-----Example---------
t=0:0.1:20
y=sin(t);
plot(t,y)
%-------------------------
xl=get(gca,'xlim')
xti=[0.2:0.1:1 0.9:-0.1:0.2]
set(gca,'xtick',linspace(xl(1),xl(2),numel(xti)))
xti1=arrayfun(@num2str,xti,'un',0)
set(gca,'xticklabel',xti1)

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by