如何保存具有选中元素的Matlab图形

huangapple go评论47阅读模式
英文:

How to save matlab figure with brushed elements

问题

我可以保存图表,使用 文件->另存为,将其保存为 .fig 格式。但它没有保存我在上面刷选的项目。

如何保存带有刷选项目的图表?

我使用以下命令打开图表:
uiopen('C:\Users\user\Desktop\MATLAB\2.fig',1)

英文:

In MATLAB i can save chart using File->Save As, and saving it as figure .fig. But it did not save items which i brushed on.

How can i save chart with brushed items?

I open figure using command:
uiopen('C:\Users\user\Desktop\MATLAB\2.fig',1)

答案1

得分: -1

如果不需要将图形保存为 .fig 文件,刷选信息可以在将图形保存为像 png、jpg 等图像格式时保留。

示例:

plot([1:10],[1:10])

在图形上执行所有需要的刷选操作,然后使用以下代码保存图像:

saveas(gcf,'FigureBrushed.png')

您可以使用以下代码显示图像:

im = imread('FigureBrushed.png');
imshow(im)

注意:您将失去数组信息(X 和 Y 的值将仅以图像形式显示,而不作为数组),您可能需要另外保存 .fig 文件或工作空间以保留绘图的所有信息(X 和 Y 的值)。

英文:

If it is not necessary to save the figure as .fig , the brushing informations can be kept if figure is saved in image format such as png,jpg.

example:

plot([1:10],[1:10])

Do all the brushing you need on the figure and then

saveas(gcf,'FigureBrushed.png')

you can use the following to display the image.

im = imread('FigureBrushed.png');
imshow(im)

Note: You will lose the arrays information (The values of X,Y -- they will be just displayed in the image but not as an array), you might need to save the fig or the workspace as well to keep all information of your plot (X,Y Values).

huangapple
  • 本文由 发表于 2023年6月16日 13:25:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76487167.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定