How to stop log axis shift
20 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
vauntedmango
le 1 Juil 2024 à 9:48
Commenté : vauntedmango
le 1 Juil 2024 à 10:54
Hello,
I am trying to generate 5 different 3d waterfall plots (each representing a flow speed from 20m/s to 60m/s). One of the axes in each of the graphs represents frequency and is set to be logarithmic by using: 'set(gca, 'XScale', 'log');'
The frequency values within the 'waterfall' function are normalised by dividing by the respective flow speed.
Eg: for 20m/s, h = waterfall(F/20, blowingRates, DPWL20_filtered');
Since F starts at 0, I wasn't worried about the lower x limit, but I set the upper limit to max(F)/60 for all plots to ensure they all cover the same X range: xlim([0 max(F)/60])
When I try to plot these, I notice the frequency axes shift, despite enforcing xlim
Is there a better way to keep the axes the same for all plots?
Here are images for the plots so far:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1725191/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1725196/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1725201/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1725206/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1725211/image.png)
0 commentaires
Réponse acceptée
Tomoaki Takagi
le 1 Juil 2024 à 10:39
You can't plot 0=10^(-inf) on a log scale.
The lower x limit must be a positive number.
For example, try xlim([0.1 max(F)/60]) or xlim([0.01 max(F)/60]).
Of course, 0.1=10^-1 and 0.01=10^-2.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Axis Labels 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!