How to enlarge/Scale/Increase size of a contour plot
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Tushar Behera
el 30 de En. de 2023
Editada: Tushar Behera
el 30 de En. de 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 comentario
HARISH KUMAR
el 30 de En. de 2023
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


