![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/389953/image.png)
How to put a preview figure window in a main figure window
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sadiq Akbar
le 23 Oct 2020
Commenté : Sadiq Akbar
le 23 Oct 2020
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')
0 commentaires
Réponse acceptée
Ameer Hamza
le 23 Oct 2020
Modifié(e) : Ameer Hamza
le 23 Oct 2020
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);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/389953/image.png)
9 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!