删除Matlab图周围的边界 [英] Remove border around Matlab plot

查看:92
本文介绍了删除Matlab图周围的边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Matlab在绘图周围显示黑色边框,我想将其删除.我想我应该使用类似的东西:

Matlab is displaying a black border around a plot and I would like to remove it. I think i should be using something like:

set(Figure#,'PropertyName',PropertyValue);

但是我不确定应该使用哪个PropertyName或PropertyValue ...

But I'm not sure what PropertyName or PropertyValue should be used...

我尝试了所有建议,包括:

I tried all of the suggestions including:

set(gca,'box','off');
set(gca,'xcolor','w','ycolor','w','xtick',[],'ytick',[]);
axis off;

该人物仍然是黑人,看上去像这样:

The figure still has a black boarder and looks like this:

这是一个简化的程序包,可复制黑匣子.运行名为"runPlot"的脚本.这里是: http://dl.dropbox.com/u/8058705/plotTest.zip 我不知道为什么该框仍然可见.这可能是由于"plotTEC.m"中的行

Edit 2: This is a simplified package that reproduces the black box. Run the script called "runPlot". Here it is: http://dl.dropbox.com/u/8058705/plotTest.zip I can't figure out why the box is still visible. This might be due to the line in "plotTEC.m"

axis([-.65 .6 .25 1.32]) % hardwiring axis length since the coastline runs off of the plot

@Pursuit:如果我使用绘图浏览器",则会遇到递归错误....我不熟悉matlab绘图程序包,但这似乎很奇怪.还有其他人得到此错误吗?再次感谢你们的建议!

@Pursuit: If I use "plot browser" I get a recursive error....I am not familiar with the matlab plotting package but this seems strange. Does anyone else get this error? Again, thank you guys for your advise!

还有其他建议吗?

提前谢谢!

推荐答案

您要尝试使用轴的属性.一些有趣的属性.

You want to experiment with the properties of the axis. Some properties of interest.

xcolor  %The color of the x-axis line and the x axis labels
ycolor  %
box     %'on', or 'off' indicating if one or both sides of a plot should have lines
xtick   %Where to place the labels
ytick

对于完全裸露的情节,请使用:

For a completely bare plot, use:

figure
set(gca,'xcolor','w','ycolor','w','xtick',[],'ytick',[])

也要将图形背景设置为白色

To set the figure background to white as well

set(gcf,'color','w')

根据您的具体问题,您可以尝试使用'box'属性,以了解它如何影响您的绘图

Depending on your exact problem, you can try the 'box' property, to see how it affects your plots

set(gca,'box','on')
set(gca,'box','off')


如果您想关闭实际的绘图线但保留绘图标签,那么我不知道有一个简单的解决方案.我认为我需要如上所述移除轴,然后使用text函数手动添加标签.


If you want to turn off the actual plots lines but keep the plot labels then I am not aware of a simple solution. I think that I would need to remove the axes as described above, and then manually add labels using the text function.

正如我刚从这个问题中学到的,绘图重叠MATLAB ,您也可以尝试

As I just learned from this question, Plot Overlay MATLAB you can also try

axis off
axis on

我认为等同于

set(gca,'visible','off')
set(gca,'visible','on')



Edit 2:

如果没有其他效果,请激活图中的绘图浏览器".使用视图"->绘图浏览器".在绘图浏览器面板中,取消选中每个对象,直到找出哪个对象正在绘制需要删除的线为止.

If nothing else works, activate the "plot browser" in your figure. Use "view" --> "plot browser". From the plot browser panel, uncheck each object until you figure out which object is drawing the lines that you need to remove.

然后双击有问题的对象以打开属性编辑器"面板,并且很可能单击更多属性"以查看该对象的所有可能的属性.从该视图中,您可以(希望)找出是哪个对象在绘制令人讨厌的线条.

Then double click on the offending object to bring up the "property editor" panel, and mostly likely click "More properties" to view all possible properties of that object. From that view you can (hopefully) figure out what object is drawing the offending lines.

弄清楚要编辑的对象和属性后,您可能可以找出在对象中代码的创建位置,并以编程方式设置该属性.

After you have figured out the object and property to edit, you can probably figure out where in the code that object is created, and set the property programmatically.

这篇关于删除Matlab图周围的边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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