From: Alex on 6 Jul 2010 13:06 When you go to export figure setup there is an option to expand axes to fill figure which removes all the whitespace around the figure. Is there a way to make this the default action for all plots in matlab? I tried just exporting to "default" but this did not appear to have an effect. I am ~ familiar with setting default properties in the startup.m file, but I am not sure what property this is to set. Thanks! Alex
From: Matt Fig on 6 Jul 2010 13:17 Perhaps: set(0,'defaultaxesposition',[0 0 1 1])
From: Alex on 6 Jul 2010 13:45 That will expand the plot, but if I add labels then they are cropped off by the plot (as are the tick marks). It is in the right direction though... "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i0voeh$n9q$1(a)fred.mathworks.com>... > Perhaps: > > set(0,'defaultaxesposition',[0 0 1 1])
From: Matt Fig on 6 Jul 2010 15:25 I see what you mean now. I think all that option does is this: T = get(gca,'tightinset'); set(gca,'position',[T(1) T(2) 1-T(1)-T(3) 1-T(2)-T(4)]); So if you want all plots to have this automatically, I believe you would have to overload the plot function, something like this: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [varargout] = plot(varargin) % Overloads the PLOT function when called in this directory. N = nargout; if N varargout = cell(N,1); [varargout{:}] = builtin('plot',varargin{:}); else builtin('plot',varargin{:}) end T = get(gca,'tightinset'); set(gca,'position',[T(1) T(2) 1-T(1)-T(3) 1-T(2)-T(4)]); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Also, you would have to add those two lines at the end of the M-Files: XLABEL, YLABEL and TITLE.
From: Alex on 6 Jul 2010 16:02 OK, Thanks. It is a little bit kludgy, but it will work. I thought I was missing some really obvious parameter somewhere, but I guess not. Thanks! "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i0vvuh$6b8$1(a)fred.mathworks.com>... > I see what you mean now. I think all that option does is this: > > T = get(gca,'tightinset'); > set(gca,'position',[T(1) T(2) 1-T(1)-T(3) 1-T(2)-T(4)]); > > So if you want all plots to have this automatically, I believe you would have to overload the plot function, something like this: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > function [varargout] = plot(varargin) > % Overloads the PLOT function when called in this directory. > N = nargout; > > if N > varargout = cell(N,1); > [varargout{:}] = builtin('plot',varargin{:}); > else > builtin('plot',varargin{:}) > end > > T = get(gca,'tightinset'); > set(gca,'position',[T(1) T(2) 1-T(1)-T(3) 1-T(2)-T(4)]); > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > Also, you would have to add those two lines at the end of the M-Files: XLABEL, YLABEL and TITLE.
|
Pages: 1 Prev: InteractiveBrokers API and MATLAB Next: fit multiple curves together |