Data does not plot after setting XTick and XTick Label
이전 댓글 표시
I am trying to plot the data in the image such that the only Xaxis points that are shown are the ones that have a data point there. I find all the Xaxis point that have data and store them in an array called UniqueFreq.
UniqueFreq =
2012 2015 2018 2020 2023 1882 1885 1900 1915 1918
set(gca,'xtick',1:numel(unique(UniqueFreq)));
hold on
set(gca,'xticklabel',unique(UniqueFreq))
hold on
xlim([0 numel(unique(UniqueFreq))+1]);
hold on
ylim([(min(YLim) - 0.5) (max(YLim) + 0.5)]);
After I do the above I try to plot the data using:
plot(DataArray{i,8},DataArray{i,9},'-o');
hold on
Where the X value is always one of the values in the XTick, for example, a plot value would be: plot(2012,1.5); However when I do this nothing plots.
If anyone has any idea it would be really helpful.
Thanks!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!