how to change the X-axis unit interval
12 ビュー (過去 30 日間)
古いコメントを表示
Hello Everyone,
Does anyone know how to adjust only the Axis interval/unit, without changing the outcome (dataset) of the graph.
I have a dataset of X and Y in 15-Min interval of a half year (each approx 17500 arrays). I wish to show the X-axis in hourly interval and Y-Axis in 15 minutes interval as it is. If I carry out changes to adjust the graph in a hourly interval (approx 4400 arrays) by taking the mean value, i would be missing out the max or min value of 15 min Interval, and thus not get the same curve as displayed below. I wish keep the graph curve as it is and change only the X-axis units from 15 min (0, 2000, 4000, ..... 18000) to hourly (0.500, 1000, ... 4500).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/262247/image.png)
0 件のコメント
採用された回答
Eunan McShane
2020 年 1 月 17 日
Hey,
This might not be the cleanest solution however you can manually change the xtick labels whilst keeping them in the same location as before
Use xticks([0 2000 4000...])
and xticklabels({'0.5','1000','x'...})
If I am understanding correctly this should be a quick fix for the plot, hopefully that helps
Cheers
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!