필터 지우기
필터 지우기

Labeling x-axis in bar function in a figure

조회 수: 1 (최근 30일)
Lily
Lily 2012년 10월 1일
Hi
Is it possible to label the xabel on figure 1 with words (see code below) i.e. 1 would be come 'mean' and 2 would be come 'std'?
m = [0.4 0.6 0.2]; %mean
s = [0.15 0.04 0.12]; %standard deviation
yhat = [m ; s];
yhat = [mvelocity ; svelocity];
figure(1)
bar(yhat);
hold on
colormap summer % Change the color scheme
hleg = legend('F1','F2','F1+F2');
set(hleg,'Location','NorthWest')
set(hleg,'Interpreter','none')
ylabel('Velocity [m/s]')
hold off

채택된 답변

Wayne King
Wayne King 2012년 10월 1일
Yes, just
set(gca,'xticklabel',{'mean','std'})

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by