How do I plot a date along the x-axis?
Show older comments
Hi! I have 2 sets of data that shows temperature over a long period of time. I am trying to plot a graph with dates along the x-axis.
I have shortened the data as my original table has hundreds of points, but one is a table formatted like this:
Country M/DD/YY M/DD/YY M/DD/YY
---------- ------- ------ ------
{CountryA} 15 18 20
{CountryB} 17 22 25
{CountryC} 16 19 22
where the date is formatted in the table's column variable.
Another is a table like this:
Date Temperature
----- -----------
{'M/DD/YY'} 20
{'M/DD/YY'} 22
{'M/DD/YY'} 24
where the date is formatted inside a cell in the first column of a table.
I'm assuming it has something to do with the x-ticks and datetime functions, but I can't seem to get my 'start' point as my first date and my last point as the last point in my data. As this is being updated daily, this last point keeps changing.
Accepted Answer
More Answers (0)
Categories
Find more on Calendar in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!