how to change the X-axis unit interval

12 Ansichten (letzte 30 Tage)
Sehoon Chang
Sehoon Chang am 17 Jan. 2020
Beantwortet: Eunan McShane am 17 Jan. 2020
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).

Akzeptierte Antwort

Eunan McShane
Eunan McShane am 17 Jan. 2020
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

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by