is it possible to use square subplots?
58 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mr M.
el 7 de Jul. de 2015
Comentada: Jan
el 7 de Jul. de 2015
if I use axis image: the problem is the gaps are too big between subplots, I would like to adjust the figure size also automatically, if possible
0 comentarios
Respuesta aceptada
Image Analyst
el 7 de Jul. de 2015
You can use "axis square" though that does not do anything for the large amount of blank space between plots. You'll need set(gca, 'Position', [x,y,w,h]) for that.
0 comentarios
Más respuestas (2)
Jan
el 7 de Jul. de 2015
Editada: Jan
el 7 de Jul. de 2015
figure('Position', [100, 100, 400, 400]);
axes
axis('equal') % [EDITED: or better 'square' !]
2 comentarios
Jan
el 7 de Jul. de 2015
@Mr. M: The documentation is clear:
doc figure
doc plot
doc subplot
figure creates a window. plot draws a line and creates an axes object implicitly. subplot creates an axes object with a specific position - so "subaxes" would be a better name.
Ivan Shorokhov
el 7 de Jul. de 2015
Editada: Ivan Shorokhov
el 7 de Jul. de 2015
For each subplot, store its handle.
h = subplot(2,3,1);
Then set the 'position' property of h to be anything you want.
p = get(h, 'pos');
This is a 4-element vector [left, bottom, width, height] which by default is in normalized coordinates (percentage of figure window). For instance, to add 0.05 units (5% of figure window) to the width, do this:
p(3) = p(3) + 0.05;
set(h, 'pos', p);
The SUBPLOT command picks standard values for these parameters, but they could be anything you want. You could put axes anywhere on the figure you want, any size you want.
Please vote for the answer.
3 comentarios
Ivan Shorokhov
el 7 de Jul. de 2015
Editada: Ivan Shorokhov
el 7 de Jul. de 2015
you can find an answer in the following link: http://uk.mathworks.com/help/matlab/creating_plots/aspect-ratio-for-2-d-axes.html
Ver también
Categorías
Más información sobre Subplots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!