How to condense a plot with a shorter x-axis?

4 vues (au cours des 30 derniers jours)
Taoooooooooooo
Taoooooooooooo le 19 Fév 2020
Hi,
Please look at attached plots(before and after). I want to condense a plot with x-axis of (0 12E^6) to (0 1) without losing any information of the initial plots. I have tried "linspace" and other methods, seems not working in the way as I wanted it to. Please help!
Tao

Réponses (2)

Bhaskar R
Bhaskar R le 19 Fév 2020
Modifié(e) : Bhaskar R le 19 Fév 2020
Normalize your data
t = 1:1000000; % assumed data
d = linspace(0, 1, numel(t)); % create vector of length t from 0 to 1
plot(d, t);

Star Strider
Star Strider le 19 Fév 2020
Divide the x-axis vector by max(x), assuming ‘x’ is the x-axis vector. That will re-scale it without losing any information.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by