【问题标题】:Hold (lock) zoom or set zoom based on image size in Matlab在 Matlab 中根据图像大小保持(锁定)缩放或设置缩放
【发布时间】:2017-03-10 08:30:18
【问题描述】:

我需要在上面绘制两个数字和一些点。这些点可以超出图像区域的大小,这使得 Matlab 可以“自动缩放”以适应绘制的点。问题是这使得比较两个图像变得困难,因为两个图像的缩放不一样。那么,我该怎么做:

  1. 按住/锁定图形缩放,这样我可以在添加图像后和绘制点之前锁定它。 或
  2. 根据图像大小(百分比)设置缩放。

示例代码:

imshow(myFig1);
hold on;
% Here I need to hold/lock the zoom or...
plot(myPoints1(1,:),myPoints1(2,:),'+b');
% ... or set here the zoom based on a percentage of the image size

imshow(myFig2);
hold on;
% Here I need to hold/lock the zoom or...
plot(myPoints2(1,:),myPoints2(2,:),'+b');
% ... or set here the zoom based on a percentage of the image size

【问题讨论】:

    标签: matlab plot matlab-figure


    【解决方案1】:

    锁定轴大小:

    axis manual
    

    来自documentation

    axis manual:将所有轴限制冻结在当前值。

    【讨论】:

    • 哦,当然,谢谢你让我振作起来。今天的工作就够了,哈哈。
    猜你喜欢
    • 2016-05-24
    • 2012-08-24
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 2014-06-21
    • 1970-01-01
    • 1970-01-01
    • 2011-06-21
    相关资源
    最近更新 更多