Zooming a portion of a figure with multiple .mat files

Hello everyone, I have this image having four graphs. I want to zoom-in on the end overlapped section of this figure. This is mainly required to indicate the detail of a particular segment. Any help guys. Thank you.

 Accepted Answer

The easiest way is likely to create another figure with the same data, but setting the axis limits to something like:
axis([6 8 0.25 0.35])
Experiment with those to get the result you want.

7 Comments

But i want it to in the same figure window.
I have done something like this. But i am not getting other three graphs on the bigger window. By the way, i am using a loop for plotting each graph which belong to a different mat file.
figure(6);
hold on;
plot(total_offer_traffic,Power_Consumption_Rating_Store_hbs/1e-9,colors(scheme2,:),'linewidth',2);
box on;
title('Power Consumption Rating for HBS');
xlabel('Offered Traffic (Gbps)');
ylabel('Power Consumption Rating (nW per bit)'); %\mu
axes('position',[.5 .3 .25 .25])
box on
indexOfInterest=(total_offer_traffic <7.9) & (total_offer_traffic>6.9);
plot(total_offer_traffic(indexOfInterest),Power_Consumption_Rating_Store_hbs(indexOfInterest)/1e-9);
axis tight
hold off;
Your approach to the inserted plot is essentially what I would have suggested.
If you’re plotting the figure in a loop, I would create the second figure after the loop by getting the data from the first complete figure (this is relatively straightforward in R2014a and before, but can be a daunting task in R2014b and later and can involve cell arrays with multiple cell array indexing), and then plotting it as the sub-figure with the appropriate axis limits.
I cannot follow your code to the extent that I can understand the reason the full plot is not plotting all the data and the inserted plot is. I would look closely at where your hold calls are and see if that could be the problem. Calling hold before the first plot can frequently cause problems, the reason I always plot the first set of data, then call ‘hold on’ and do the rest of the plots. I’ve not had problems with that strategy.
Hi bro, I just managed it now. Wana show you. Thank you.
My pleasure.
I assume my suggestions had nothing to do with your success.
This was the important line for me in your reply. "I would create the second figure after the loop by getting the data from the first complete figure"
Good nite.
And quite a good one it will be!
I’m glad I was able to help in some way.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!