Conflict in surf command between zscale and zlim?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
I'd like to plot several 3D surfaces with semilog scale on z-axis, but also set the z-axis limit to be the same, so I do:
set(gca, 'ZScale', 'log')
axi_lim = [0, err0];
zlim(axi_lim)
The z-axis is semilog as I want, but the axis limit is different, like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161028/image.png)
How can I make all the z-axis exactly the same? Many thanks!
0 Kommentare
Antworten (1)
Star Strider
am 23 Feb. 2017
See if this addition does what you want:
set(gca, 'ZScale', 'log')
axi_lim = [0, err0];
zlim(axi_lim)
axis tight % <— ADD THIS LINE HERE
2 Kommentare
Star Strider
am 23 Feb. 2017
I don’t have the rest of your code to experiment with.
See if this syntax change works:
axi_lim = [0, err0];
set(gca, 'ZScale', 'log', 'ZLim',axi_lim)
axis tight
This can work when a direct call to the zlim function fails.
Siehe auch
Kategorien
Mehr zu Subplots 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!