使用映射工具箱时从 MATLAB 图删除白色背景框

发布于 2024-12-02 07:00:34 字数 321 浏览 3 评论 0原文

我已经开始在我的一个项目中使用 MATLAB 中的映射工具箱,下面是我当前使用它创建的内容的屏幕截图。

在此处输入图像描述

我现在要做的是从实际地图后面删除白框,但我可以似乎不知道该怎么做。我在第一次创建地图时尝试使用axesm命令将“Frame”设置为“off”,但这并没有做到。我查看了文档,试图找出为什么会有白色背景(当我使用 worldmap 命令时,该框不会出现),但我无法确定原因。

编辑:我希望完全删除白色背景,以便使主轮廓图被图形的背景颜色包围,在本例中为灰色。

I've started to use the Mapping Toolbox in MATLAB for a project of mine, and below is a screenshot of what I currently have created using it.

enter image description here

What I'm trying to do now is remove the white box from behind the actual map, but I can't seem to figure out how to do it. I've trying setting 'Frame' to 'off' with the axesm command when first creating the map, but that doesn't do it. I've looked through the documentation to try to figure out why there's even a white background (and when I use the worldmap command the box doesn't appear), but I cannot determine why.

EDIT: I am looking to remove the white background entirely, so as to have the main contour plot surrounded by the figure's background color, which in this case is the gray.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小嗲 2024-12-09 07:00:34

图形的背景颜色是该图形的一个名为“颜色”的属性。
如果您将该属性设置为值“none”,那么您将没有背景。

因此,最简单的方法是:

set(gca,'color','none')

当然,您可以提供图形句柄而不是当前轴(gca)。

更激进的选择是关闭整个轴:

axis off

但这将完全删除轴,包括标签等,这可能不是您想要的。

The background color of a figure is a property of that figure named 'color'.
If you set that property to the value 'none' then you will have no background.

So, the easiest way to do it is:

set(gca,'color','none')

Of course you can give a figure handle instead of the current axes (gca).

The more aggressive option is to set the entire axis off:

axis off

But this will remove the axis completely, including labels and such which might not be what you want.

人│生佛魔见 2024-12-09 07:00:34

当焦点处于焦点时尝试 axis off,不在焦点时尝试 axis(handle,'off')

Try axis off when it's in focus, axis(handle,'off') when not

夜空下最亮的亮点 2024-12-09 07:00:34

我有一个潜在的解决方案。

如果您运行

get(figure(1))

查找图形属性并运行

set('some resize property',[some set of values])

或,

setm('some resize property',[some set of values])

您可能可以通过这种方式“填充”空间,除非有更容易更改的属性。如果这不能解决问题,您能否提供更多详细信息?

希望这有帮助!

I have a potential solution.

If you run

get(figure(1))

to find the figure attributes and run

set('some resize property',[some set of values])

or

setm('some resize property',[some set of values])

You may be able to 'fill in' the space this way, unless there is an easier property to change. Can you please give more details if this does not lead to a solution?

Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文