Not able to extract data from fig file having subplots

There are 7 subplots in my fig file , am able to extract data from all but not able to extract data from 6 fig .
Could anyone tell me why the 6th subplot data am not able to extract am using this code.Once i execute the command
the data gets vanished from the figure file
clc
clear all
h=findobj(subplot(7,1,6),'Type','line');
x=get(h,'Xdata');
y=get(h,'Ydata');
for i =1:size(y)
z{i,1}=(y{i,1}');
end

8 件のコメント

Ameer Hamza
Ameer Hamza 2020 年 10 月 8 日
Does axes 6 also contain a line object? Maybe it contains some other graphics object.
Sandeep Nair
Sandeep Nair 2020 年 10 月 8 日
Yes ,it looks like line object only,whenever am executing the command for sixth subplot the h value is 0x0 graphics placeholder
Ameer Hamza
Ameer Hamza 2020 年 10 月 8 日
h = 0x0 means that it is not a line. Can you share your .fig file.
Sandeep Nair
Sandeep Nair 2020 年 10 月 8 日
sorry,i cant share the fig file ,can you please tell me other options which i can try
Ameer Hamza
Ameer Hamza 2020 年 10 月 8 日
Check what type of graphic object is present. What is the output of these lines
ax = subplot(7,1,6);
ax.Children
Sandeep Nair
Sandeep Nair 2020 年 10 月 8 日
編集済み: Sandeep Nair 2020 年 10 月 8 日
When i open the file i can see the figure with data on it .
When i ran the command
get(subplot(7,1,6),'Type')
it returned
'axes'
when i open the file i can see the data and i can see the datatips as well ,but when am running command for findobj
the graph is disappearing.Please help
Ameer Hamza
Ameer Hamza 2020 年 10 月 8 日
Without knowing what is present in subplot 6, it is difficult to suggest a solution. The children property tells what type of object is children of that axes.
VBBV
VBBV 2020 年 10 月 11 日
編集済み: VBBV 2020 年 10 月 11 日
clc
clear all
ax = subplot(7,1,6)
h=findobj(ax,'Type','line');
x=get(h,'Xdata');
y=get(h,'Ydata');
for i =1:size(y)
z{i,1}=(y{i,1}');
end
use the property, value type arguments for findobj . pass the handle of subplot to findobj

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

質問済み:

2020 年 10 月 8 日

編集済み:

2020 年 10 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by