How to rescale x- axis?
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
so when i plot my function, i get a wide graph.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169075/image.png)
but i need a narrower graph.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169077/image.png)
I tried to used limx function and I thought i got it, however, when changing the input value, meaning get a different graph that is wider than 15, my graph will cut off due to limx. I could increase the limx interval however, if the input keeps on changing, i cannot use limx. is there a way you can commend Matlab to set auto scale like the bottom graph? so whatever input value i give, it can always adjust scale to become a narrower graph.
(This is what i get when i change my input value)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169078/image.png)
(This is what I want my graph to look like)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169079/image.png)
0 Commenti
Risposte (1)
David Goodmanson
il 18 Gen 2018
Modificato: David Goodmanson
il 18 Gen 2018
Hi Petronas,
If the width of the spiral is proportional to some input value, you can come up with an appropriate constant and use
xlim([-C*input_value, C*input_value])
and if the plot limits need to be some more complicated function of some input value then you can plug that function into the xlim expression.
4 Commenti
Star Strider
il 18 Gen 2018
As always, my pleasure!
The axis equal call uses the same length for the data units along each axis.
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!