如何在Matlab中全局设置轴限制? [英] how to set axis limits in matlab globally?

查看:140
本文介绍了如何在Matlab中全局设置轴限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看似微不足道,但我找不到解决办法.我在函数中有plot,并且正在从主函数传递数据.在主要功能中,我设置了这样的轴axis([-10, 10, -10, 10]);;但是,每次调用具有plot的函数时,它都会自动更改轴.有没有一种方法可以全局设置图形,以便所有功能都可以使用一个具有固定属性的图形?

It seems trivial but I couldn't find a way to do it. I have plot in a function and I'm passing data from the main function. In the main function, I set the axes like this axis([-10, 10, -10, 10]);; however, every time I call the function which has plot, it changes the axes automatically. Is there a way to set the figure globally so that all functions can use one figure with fixed properties?

推荐答案

您可以按以下方式全局设置x和y轴限制(至少在R2013a中如此设置):

You can setup x and y axis limits globally as follows (at least in R2013a):

set(0,'defaultaxesxlim',[-10 10]);
set(0,'defaultaxesylim',[-10 10]);

这篇关于如何在Matlab中全局设置轴限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆