Borrar filtros
Borrar filtros

add labels to x axis

4 visualizaciones (últimos 30 días)
talayeh ghodsi
talayeh ghodsi el 27 de Nov. de 2020
Comentada: Ameer Hamza el 27 de Nov. de 2020
Hi every body.
I have 10 mean plus/minus standard daviations of 10 patients. i want to plot an error bar with lables of patients in x axis. and i have written the code below, but it doesnt work and x lables are 1:10 instead of P1:P10
X = categorical({'P1','P2','P3','P4','P5','P6','P7','P8','P9','p10'});
X = reordercats(X,{'P1','P2','P3','P4','P5','P6','P7','P8','P9','p10'});
mean=[0.81,0.77,0.84,0.86,0.98,0.90,0.84,0.79,0.81,0.89]
STD=[0.36,0.22,0.11,0.13,0.05,0.01,0.06,0.06,0.1,0.02]
errorbar(X,mean,STD)
could anyone help me we that please?

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 27 de Nov. de 2020
Add this line at the end of your code
xticklabels(X)
  2 comentarios
talayeh ghodsi
talayeh ghodsi el 27 de Nov. de 2020
Thanks a lot for your answer.
Ameer Hamza
Ameer Hamza el 27 de Nov. de 2020
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by