How to make contour to have the same axes
Show older comments
I have a two different plots with 2 different axes. The second plot (fig2) is extracted from the first plot (fig1).
Please how can I make the extract plot to have the same axis as the first one. I tried aspect ratio function but couldn't work.
openfig('fig1.fig');
openfig('fig2.fig');
11 Comments
Cris LaPierre
on 9 Feb 2024
Please share the code you used to create both plots.
Are you saying fig2 should keep the axes as labeled, with the plot filling the figure window, or should the figure essentially be zoomed to the exact borders of the contour plot so that it fills the figure window?
University
on 9 Feb 2024
University
on 9 Feb 2024
Cris LaPierre
on 9 Feb 2024
Edited: Cris LaPierre
on 9 Feb 2024
The reason it is not filling the axes is because you have set the limits of fig2 to be the same as fig1. If fig2 is indeed a subset of fig1, then you need to use the limits of the data in fig2 to set the axes limits. Otherwise, you are plotting it the same size it was in the original figure. Where there is no data remains white.
Cris LaPierre
on 9 Feb 2024
Also, I think you copied the same code twice rather than code that creates the 2 figures you attached.
University
on 9 Feb 2024
University
on 9 Feb 2024
Cris LaPierre
on 9 Feb 2024
Edited: Cris LaPierre
on 9 Feb 2024
Can you update your post to use the tools in the ribbon to create formatted code, and then run that code so that it creates each figure here? Smiilar to what I did here.
University
on 9 Feb 2024
Answers (0)
Categories
Find more on Image Arithmetic 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!



