matlab copyobj,merge 2 matlab fig into 1 - how to use color , linewidth etc using copyobj

I want to load 2 figures and merge them in one.

I know that I can do it by copy paste from one figure to another ,but through script?

I saw this , but it produces the 2 figures.How can I merge them in one (like using hold on)?

Also, can I change the axis dimension from one figure?Use only a part of its dimension?

And , how to change the color,style etc ?

----UPDATE---------------------------

My code right now is:

fig1=open('fig13.fig');

fig2=open('fig14.fig');

ax1=get(fig1,'Children');

ax2=get(fig2,'Children');

for i = 1 : numel(ax2)

ax2Children = get(ax2(i),'Children');

tri=get(ax1(i),'Children');

hold on;

first=copyobj(tri, ax1(i));

second=copyobj(ax2Children, ax1(i));

end

set(first,'color','g','marker','circle');

set(second,'color','b');

legend(first, {'first'}, 'Location','NorthWest', 'Color','g');

legend(second, {'second'}, 'Location','NorthWest', 'Color','b');

1) How can I specify the linewidth , marker,etc..Because using set(first,'marker','circle') for example doesn't work.

2) How can I use only a part of axis dimension of fig14 for example.

The fig13 for example (x axis) is (-8,4) and in fig14 is (-2 ,10).How can I do the merging graph to (-8,8)?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值