How to put a preview figure window in a main figure window

조회 수: 6 (최근 30일)
Sadiq Akbar
Sadiq Akbar 2020년 10월 23일
댓글: Sadiq Akbar 2020년 10월 23일
I have a code that gives me the plot of my data. I want to put the same plot figure as a preview in top left corner of the same plot figure window. My code is below:
x=0.01*rand(100,1);
[~,edges] = histcounts(log10(x));
histogram(x,10.^edges)
set(gca, 'xscale','log')

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 23일
편집: Ameer Hamza 2020년 10월 23일
You can create a second smaller axes
x=0.01*rand(100,1);
ax1 = axes();
[~,edges] = histcounts(log10(x));
histogram(x,10.^edges)
set(gca, 'xscale','log')
ax2 = axes('Position', [0.05 0.75 0.2 0.2], 'XScale', 'log', 'Box', 'on');
copyobj(ax1.Children, ax2);
  댓글 수: 9
Ameer Hamza
Ameer Hamza 2020년 10월 23일
I don't have R2016b so I am not able to try it.
Sadiq Akbar
Sadiq Akbar 2020년 10월 23일
Ok Dear Ameer Hamza. Doesn't matter. You have solved till now.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by