How can I create a bar plot from sorted values with correct sorted label values?
20 views (last 30 days)
Dear All, I would like to create a bar plot with sorted precipitation data (pr) along its sorted date (date). I tried the following:
I got the attached figure. I do not understand why the figure shows the date incorrectly? I am mean I would like to have every bar one label value. Could someone suggest me a solution? Thank you for your help in advance!
Rik on 24 Feb 2017
Edited: Rik on 1 Mar 2017
As far as I understand this plot and the axis and bar objects it contains, you have only put in 4 years, but you have many more bars in pr. What you should try is the following:
labels=num2str(sorted_date);%date must be a col-vector (nx1)