Extract graph axis limits actually used when [-inf inf] has been used to assign limits
2 次查看(过去 30 天)
显示 更早的评论
My script is written to use either [-inf inf -inf inf] or an assigned set of axis limits as a variable since the script may instead compute a desired set of limits to be applied as the limit set. I need to know the limits that are actually used in order to add text to the graph. If I assign specific limits to the axis as a variable (computed or manually assigned), no problem. But if [-inf inf -inf inf] is used as the limit call, any inquiry as to the actual limits used < get(gca,'ylim') > after plotting and before adding the text, the values returned are [-inf inf], not the actual values. How do I get the values actually used when [-inf inf -inf inf] is the default input?
0 个评论
回答(1 个)
Keerthana Chiruvolu
2020-3-6
Hi,
You may set the ylim() to ‘auto’ instead of inf and then use the get(gca,’ylim’) to obtain the y limit values. This might help.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!