使用网格绘制数据

发布于 2024-08-31 20:01:06 字数 81 浏览 1 评论 0原文

当您使用meshgrid绘制数据时(使用meshgrid本身而不是其他绘图功能之一),如何将颜色更改为灰度或黑白?另外,如何摆脱图像的“网格”外观?

When you use meshgrid to plot data (using meshgrid itself not one of the other plotting functions), how do you change the color to grayscale or black and white? Also, how do you get rid of the "meshy" look of the image?

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

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

发布评论

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

评论(2

此刻的回忆 2024-09-07 20:01:06

要将颜色更改为灰度,您可以使用:

colormap(gray);

至于“网格”外观,我不能 100% 确定您的意思;但我假设你创建的任何东西看起来都是像素化的?如果是这样,请减小网格间距:

x = meshgrid(-25:25);

x = meshgrid(-25:0.5:25);

To change the colour to greyscale you can use:

colormap(gray);

As for the 'meshy' look, I'm not 100% sure what you mean; but I'm assuming whatever you've created is looking pixelated? If so, decrease your mesh spacing:

From

x = meshgrid(-25:25);

To

x = meshgrid(-25:0.5:25);
╰ゝ天使的微笑 2024-09-07 20:01:06

我不知道它是否适用于网格网格,但如果您使用 surf,您可以指定

shading interp

摆脱“网格”外观。

I don't know if it works for meshgrid, but if you use surf, you can specify

shading interp

to get rid of the 'meshy' look.

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