MATLAB: Does the plot of datetime variables in the figure (generated in MATLAB R2016a or older) appear blank when opened in a newer version MATLAB

MATLAB

I have been having a problem with some of the FIG files that I generated in MATLAB R2015b. The data in the FIG files is not displayed when I open the same FIG file in R2018b, but the data is present and can be extracted from the current axes (via the "gca" command).
Why are the plots appearing blank, and is there a way to display the plots correctly in these FIG files without having to re-plot all of them?
Here are example screenshots to illustrate the issue:
In R2015b:
In R2018b:

Best Answer

The issue is due to a change in R2016b in how datetime values are accepted by graphics/plotting, which leads to a shift in the x-axis range (since the x-variable in this case is a datetime datatype). This explains why the figure renders as expected in R2015b but not in R2018b. Detailed release notes on these graphics-related incompatibility issues for plotting datetime-based variables can be found in following link:
In order to correct this issue, I would suggest re-adjusting the axes limits. The following documentation page discusses how to do so:
Here are two possible approaches, you can use to fix the attached example:
1) Programmatic approach
Use the "xlim" and "ylim" functions, you can reset the axes limits to the appropriate range. For example, open your attached FIG file, and then execute the following MATLAB commands:
>> xlim auto
>> ylim auto
Note that you may need to manually specify the axes range if the auto-scaled range is not preferred.
2) Interactive approach
Open the figure, click on the axes whose limits to readjust, and then refer to the following steps:
a) Navigate to "Edit --> Axes Properties..."
b) Then on the popup menu for the Property Inspector, navigate to the Rulers tab and set "XLimMode" to "auto". Note that "YLim" may need to be manually specified to see all the data within the desired range.