scripting figure position commands
Mostra commenti meno recenti
I want toeliminate the wasted space at the edge of the figure window. This below code works fine for simple plots, but if I have a colorbar or legend that resides outside the main plot area, then it ends up being cropped off the figure. A similar situation is encountered when using subplots, only to a much worse degree. Here is the code I am using:
bounds = get(gca,'tightinset'); set(gca,'position',[bounds(1) bounds(2) 1-bounds(1)-bounds(3) 1-bounds(2)-bounds(4)]);
It seems that the problem is that other items such as a legend or colorbar are really a different set of axes, so they are not included in the space calculations. Any suggestions on ways to improve this?
Risposte (2)
Daniel Shub
il 18 Ago 2011
0 voti
You might want to look through the FEX
1 Commento
Michael
il 2 Set 2011
Categorie
Scopri di più su Graphics Object Properties in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!