How to enlarge/Scale/Increase size of a contour plot
Show older comments
I have a contour plot, i want to increase the size of the contour plot by all the sides ( by 30 pixels). How can it is possible.
Thanks in advance
Much appriciated your efforts
Accepted Answer
More Answers (1)
Tushar Behera
on 30 Jan 2023
Edited: Tushar Behera
on 30 Jan 2023
Hi Harish,
I believe you want to enlarge your contour plot window.
You can acheive this by using "set" function in MATLAB. Below is an example of that
[X,Y,Z] = peaks;
contour(X,Y,Z,20)
figure;
contour(X, Y, Z);
fig = gcf;
% Get current position of the figure window
position = get(fig, 'Position');
% Increase the size of the figure window by 30 pixels on all sides
newPosition = position + [0 0 30 30];
% Set the new position of the figure window
set(fig, 'Position', newPosition);
The "gcf" function returns the handle to the current figure window, and the "get" function retrieves the current position of the figure window. The new position is then calculated by adding [0 0 30 30] to the current position, which increases the size of the window by 30 pixels on all sides. Finally, the "set' function is used to set the new position of the figure window.
I hope this resolves your query.
Regards.
Tushar
1 Comment
HARISH KUMAR
on 30 Jan 2023
Categories
Find more on Contour 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!

