How to add 'No data' and label data on Bar plot?
Afficher commentaires plus anciens
I already get the bar graph but I want to display 'No data' for June and July and I would like to display the data label for each data for each month.
This is my coding,thank you.
Y=[-8.9663 -6.7126 -7.8211 -8.8894 -5.2922 NaN NaN -8.5105 -8.5261 -7.6346 -12.0376 -11.7094]
figure1 = figure;
axes1 = axes('Parent',figure1);
hold(axes1,'on');
bar(Y);
text('Parent',axes1,'Rotation',90,'String','No Data','Position',[6 NaN 0]);
text('Parent',axes1,'Rotation',90,'String','No Data','Position',[7 NaN 0]);
ylabel('Intensiti arus MCEJ1 pada tahun 2014');
xlabel('Bulan');
hold(axes1,'off');
set(axes1,'XAxisLocation','top','XTick',[1 2 3 4 5 6 7 8 9 10 11 12],...
'XTickLabel',...
{'Jan','Feb','Mar','Apr','Mei','Jun','Jul','Ogos','Sep','Okt','Nov','Dis'});
1 commentaire
dpb
le 13 Déc 2020
"and I would like to display the data label for each data for each month."
Sorry, but I'm not sure what you're asking for here? You mean to add the Y value on the bar, maybe?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Discrete Data Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
