Browsing through figures, without opening them all

2 次查看(过去 30 天)
Hi!
I often print/save figures in png-format or similar, in order to be able to quickly browser through results, either using a photoviewer-program or plotting them into a pdf. However, In the the matlab-figures i usually include hidden data in for example lines and buttons/functions which I would be interested in accessing when browsing through them. (ex. buttondownfunctions on lines etc.)
I'm wondering if there is a way of browsing trough .fig files in a fast way, without opening them each separately?
Regards
Peter

回答(1 个)

Voss
Voss 2022-9-26
You can use load to inspect .fig files programmatically:
f = figure();
plot(1:10,'ButtonDownFcn','disp(''ok'')');
saveas(f,'1.fig')
delete(f);
ff = load('1.fig','-mat')
ff = struct with fields:
hgS_070000: [1×1 struct] hgM_070000: [1×1 struct]
ff.hgS_070000
ans = struct with fields:
type: 'figure' handle: 1 properties: [1×1 struct] children: [1×1 struct] special: []
ff.hgS_070000.children
ans = struct with fields:
type: 'axes' handle: 11.0002 properties: [1×1 struct] children: [1×1 struct] special: [4×1 double]
ff.hgS_070000.children(1).children(1)
ans = struct with fields:
type: 'graph2d.lineseries' handle: 22.0002 properties: [1×1 struct] children: [] special: []
ff.hgS_070000.children(1).children(1).properties
ans = struct with fields:
XData: [1 2 3 4 5 6 7 8 9 10] XDataMode: 'auto' YData: [1 2 3 4 5 6 7 8 9 10] Color: [0 0.4470 0.7410] ColorMode: 'auto' DimensionNames: {'X' 'Y' 'Z'} DimensionNamesMode: 'auto' ButtonDownFcn: 'disp('ok')' SeriesIndex: 1 SeriesIndexMode: 'auto' ApplicationData: [1×1 struct]
ff.hgS_070000.children(1).children(1).properties.ButtonDownFcn
ans = 'disp('ok')'
  1 个评论
Peter
Peter 2022-10-5
Hi and thank you for your answer!
I don't think that is what I'm looking for, since for now, my actions will be based on what i see in the picture.
For example, one (out of hundreds) figure may contain 100 lines. If a line looks suspicious, I want to load/execute certain functions based on the data contained within the line object.
In lack of other ideas I may need to create a interactive GUI for this.
Regards
Peter

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by