- In your code, you are using set(gca, 'YTick', ...) to set the y-axis ticks, which are actually numerical values from 0 to 0.51 (with a 10-minute gap). Instead, you should use set(gca, 'XTick', ...) to set the x-axis ticks since you want to display time values on the x-axis.
- Here's the corrected version of your code to set the x-axis tick labels:
- In this code, I've replaced "YTick" with "XTick" since you are setting the x-axis tick labels. Also, I've used "datestr" with "hours(xtick3)" to convert the tick values from fractional hours to a human-readable time format ('HH:MM'). The "xtickangle(45)" line rotates the x-axis tick labels by 45 degrees for better readability.
- Make sure to replace the "xData" and "yData" with your actual data plotting code, and the rest of the code should work as expected to set the x-axis tick labels to the desired time format.