in y axis i want 10^(-2000). can anyone plz help
Show older comments
set(gca, 'YScale', 'log')
ylim ([0 1e-308])
Instead of 1e-308 i want 1e-2000. how can i set the limit plz
Accepted Answer
More Answers (1)
Walter Roberson
on 21 May 2024
0 votes
1e-2000 would underflow to 0. You can only use such a number symbolically... but symbolic numbers cannot be used as limits.
You also cannot plot() such small numbers. I am not sure it is possible to fplot() them either.
Your best bet would be to rescale your numbers to something like 0 to 100 and then change your ytick labels to lie about the range.
3 Comments
Kasmita Devi
on 21 May 2024
Kasmita Devi
on 21 May 2024
You can show the text "1e-2000" on the axes.
plot(1, 1, 'o')
xticks(1)
xticklabels('1e-2000')
But as Walter stated, you cannot represent 1e-2000 as a double precision number. It underflows to 0. If you can't represent it as a double precision number, you can't plot it.
x = 1e-2000 % underflow
x == 0 % x is exactly, down to the last bit, zero
figure
h = plot(x, 1, '+');
h.XData % exactly zero
Categories
Find more on Argument Definitions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

