如何在 MATLAB 中保存带有封闭盒装区域的绘图? [英] How can I save a plot with closed boxed area in MATLAB?
问题描述
保存绘图时如何关闭顶部和右侧有黑线的绘图区域?
How can I close the plot area with black lines in the top and right side when I save a plot?
我不知道如何制作或如何搜索,如果有人知道请告诉我.
I don't have any idea how to make it or how to search, if anyone knows please tell me.
例如看下图,其中缺少线条:
For example look at the plot shown below, where the lines are missing:
推荐答案
在保存图像之前,请使用 box
命令.这将包含您的绘图以具有您在示例图像中指定的周围黑框.只需调用:
Before you save your image, use the box
command. This will enclose your plot to have the surrounding black box as you have specified in your example image. Simply call:
box on;
要关闭它,请执行以下操作:
To turn it off, do:
box off;
例子:
%// Plot a line from 1 to 5 for x and y
x = 1:5;
y = 1:5;
plot(x,y);
box on;
剧情是这样的:
如果您要关闭拳击关闭,情节如下所示:
If you were to turn boxing off, this is what the plot looks like:
box off;
是 plot
的默认行为,正如您在显示的示例图像中看到的那样.只需在绘图显示后和保存图像之前调用 box on;
即可获得所需的效果.
box off;
is the default behaviour for plot
, as you have seen in the example image you have shown. Simply call box on;
after the plot is shown and before you save your image to get the desired effect.
这篇关于如何在 MATLAB 中保存带有封闭盒装区域的绘图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!