how to change the X-axis unit interval

9 visualizaciones (últimos 30 días)
Sehoon Chang
Sehoon Chang el 17 de En. de 2020
Respondida: Eunan McShane el 17 de En. de 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).

Respuesta aceptada

Eunan McShane
Eunan McShane el 17 de En. de 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

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by