Verfasst am: 27.04.2012, 15:25
Titel: Handles in Subplot überlagern sich immer
Hallo zusammen,
ich bin ein ziemlicher Matlabfrischling und hänge jetzt schon ewig an dem Problem, dass sich die Handles in meinem Suplot überlagern, zumindest die Y-Labels des rechten Bildes mit dem Diagramm in der Mitte.
Ich habe schon einiges probiert, aber nur die Schriftgröße ändern hat wirklich Erfolg gebracht. Allerdings kann das ja nicht die einzige Lösung sein.
Ich habe noch zwei Ansätze, komme mit beiden aber nicht zurecht:
1) Outer and inner position
2) kill_siblings
Das ist der Code aus dem Subplot.m --> ich weiß nicht, ob ich dort ändern muss, damit die Subplots inklusive ihrer Legende bzw. Achsenbeschriftung eine feste Größe haben und sich nicht mehr überlagern.
Zu 2)
Ich habe den Befehl "kill_siblings" gefunden, welcher übereinander positionierte Plots, welche mit 'Position' generiert wurden, löscht und den aktuelleren darüber legt.
Aber ich will ja nicht, dass meine Plots gelöscht werden, sondern einfach nur, dass ich die Subplots sich egal welche Schriftgröße ich wähle, oder ich die Labels dünn, dick, demi oder wie auch immer mache, nicht überlagern.
Könnt ihr mir diesbezüglich helfen? Ich komme echt nicht ohne Hilfe weiter.
Hallo Harald,
also ich habe bei den LABELS bisher die Schriftgröße, Schriftart und Eigenschaften wie dünn, kursiv, fett etc. probiert.
Als HANDLES habe ich die eigentliche Grafik, also das 3dimensionale Diagramm bezeichnet, da ich dachte, dass das als Handle bezeichnet wird. Ein Handle ist ja eine Oberklasse von allenmöglichen anderen Klassenobjekten, wobei ich das auch nicht so ganz verstehe.
Also um nochmal genau das Problem zu beschreiben - das Ylabel "Frequenz in Hz" der rechten Grafik steht immer in die Diagrammfläche in der Mitte hinein und ich möchte, dass jede Diagrammfläche samt X-u. YLabel als ein Objekt sozusagen betrachtet wird, wobei die Objekte sich nicht schneiden oder überlagern dürfen.
Zu deinem Code: Diese Art der Definition habe ich auch schon in der Hilfe gelesen, allerdings ist 'Position' in den mir zur Verfügung stehenden Dateien anders definiert.
Im eigentlichen Programm, was die FFTvsTime berechnet, wie folgt:
was ist denn der Code, den du letztlich ausführst?
Mir scheint, dass der Code (erster Beitrag und zweiter Teil des zweiten Beitrags) hier Kopien aus Befehlen sind? Zudem frage ich mich, wer sich den verbleibenden Code ausgedacht hat und was er sich dabei gedacht hat. Für sich genommen sehe ich da jedenfalls recht wenig Sinn dahinter.
Harald, die PN die ich geschickt habe, verliert jetzt ihre Gültigkeit, denn ich denke ich bin der Lösung sehr nahe,
es wird höchstwahrscheinlich an meinem Subplot.m-File liegen.
Meine Frage lautet nun, wo definiere ich in meinem Subplot die OuterPosition als ActivePositionProperty? Die Hilfedatei AutomaticAxis Resize :: AxesProperties hat mich auf die Idee gebracht, aber ich kann es leider noch nicht umsetzen.
Hier mein Subplot:
Code:
function theAxis = subplot(nrows, ncols, thisPlot, varargin)
%SUBPLOT Create axes in tiled positions.
% H = SUBPLOT(m,n,p), or SUBPLOT(mnp), breaks the Figure window % into an m-by-n matrix of small axes, selects the p-th axes for % the current plot, and returns the axis handle. The axes are % counted along the top row of the Figure window, then the second % row, etc. For example,
%
% SUBPLOT(2,1,1), PLOT(income) % SUBPLOT(2,1,2), PLOT(outgo)
%
% plots income on the top half of the window and outgo on the % bottom half. If the CurrentAxes is nested in a uipanel the % panel is used as the parent for the subplot instead of the % current figure.
%
% SUBPLOT(m,n,p), if the axis already exists, makes it current. % SUBPLOT(m,n,p,'replace'), if the axis already exists, deletes it and % creates a new axis. % SUBPLOT(m,n,p,'align') places the axes so that the plot boxes % are aligned, but does not prevent the labels and ticks from % overlapping. % SUBPLOT(m,n,P), where P is a vector, specifies an axes position % that covers all the subplot positions listed in P. % SUBPLOT(H), where H is an axis handle, is another way of making % an axis current for subsequent plotting commands.
%
% SUBPLOT('position',[left bottom width height]) creates an % axis at the specified position in normalized coordinates (in % in the range from 0.0 to 1.0).
%
% SUBPLOT(..., PROP1, VALUE1, PROP2, VALUE2, ...) sets the % specified property-value pairs on the subplot axis. To add the % subplot to a specific figure pass the figure handle as the % value for the 'Parent' property.
%
% If a SUBPLOT specification causes a new axis to overlap an % existing axis, the existing axis is deleted - unless the position % of the new and existing axis are identical. For example, % the statement SUBPLOT(1,2,1) deletes all existing axes overlapping % the left side of the Figure window and creates a new axis on that % side - unless there is an axes there with a position that exactly % matches the position of the new axes (and 'replace' was not specified), % in which case all other overlapping axes will be deleted and the % matching axes will become the current axes.
%
% SUBPLOT(111) is an exception to the rules above, and is not % identical in behavior to SUBPLOT(1,1,1). For reasons of backwards % compatibility, it is a special case of subplot which does not % immediately create an axes, but instead sets up the figure so that % the next graphics command executes CLF RESET in the figure % (deleting all children of the figure), and creates a new axes in % the default position. This syntax does not return a handle, so it % is an error to specify a return argument. The delayed CLF RESET % is accomplished by setting the figure's NextPlot to 'replace'.
%
% Be aware when creating subplots from scripts that the Position % property of subplots is not finalized until either a drawnow % command is issued, or MATLAB returns to await a user command. % That is, the value obtained for subplot i by the command % get(h(i),'Position') will not be correct until the script % refreshes the plot or exits.
%
% See also GCA, GCF, AXES, FIGURE, UIPANEL
% SUBPLOT(m,n,p,H) when H is an axes will move H to the specified % position. % SUBPLOT(m,n,p,H,PROP1,VALUE1,...) will move H and apply the % specified property-value pairs % % SUBPLOT(m,n,p) for non-integer p places the subplot at the % fraction p-floor(p) between the positions floor(p) and ceil(p)
% Copyright 1984-2008 The MathWorks, Inc. % $Revision: 5.22.4.28 $ $Date: 2008/12/04 22:40:20 $
% First we check whether Handle Graphics uses MATLAB classes
isHGUsingMATLABClasses = feature('HGUsingMATLABClasses');
% Next we check whether we should ignore a possible v6 argument. if isHGUsingMATLABClasses && narg >= 4 && ~ischar(nrows)
arg = varargin{1};
ifischar(arg) && strcmpi(arg,'v6') warning(['MATLAB:', mfilename, ':IgnoringV6Argument'],... ['Ignoring the ''v6'' argument to %s.',...
' This will become an error in a future release.'], upper(mfilename));
narg = narg - 1;
varargin(1) = [];
end end
% we will kill all overlapping axes siblings if we encounter the mnp % or m,n,p specifier (excluding '111'). % But if we get the 'position' or H specifier, we won't check for and % delete overlapping siblings:
kill_siblings = 0;
create_axis = true;
move_axis = false;
delay_destroy = false;
useAutoLayout = true;
tol = sqrt(eps);
parent = get(0,'CurrentFigure');
parentfigure = parent;
if ~isempty(parent) && ~isempty(get(parent,'CurrentAxes'))
parent = get(get(parent,'CurrentAxes'),'Parent');
parentfigure = parent;
if ~strcmp(get(parentfigure,'Type'),'figure')
parentfigure = ancestor(parent,'figure');
end end
pvpairs = {};
preventMove = false;
% This is the percent offset from the subplot grid of the plotbox.
inset = [.1 .18 .04 .1]; % [left bottom right top]
if narg == 0% make compatible with 3.5, i.e. subplot == subplot(111)
nrows = 111;
narg = 1;
end
%check for encoded format
handle = '';
position = '';
explicitParent = false;
explicitPosition = false;
if narg == 1 % The argument could be one of 3 things: % 1) a 3-digit number 100 < num < 1000, of the format mnp % 2) a 3-character string containing a number as above % 3) an axis handle
code = nrows;
% Check for NaN and Inf. if(~isfinite(code)) error(id('SubplotIndexNonFinite'),'Index must be a finite 3-digit number of the format mnp.') end
% number with a fractional part can only be an identifier: if(rem(code,1) > 0)
handle = code;
if ~strcmp(get(handle,'type'),'axes') error(id('InvalidAxesHandle'),'Requires valid axes handle forinput.') end
create_axis = false;
% all other numbers will be converted to mnp format: else % Check for input out of range if(code <= 100 || code >= 1000) error(id('SubplotIndexOutOfRange'),'Index must be a 3-digit number of the format mnp.') end
thisPlot = rem(code, 10);
ncols = rem(fix(code-thisPlot)/10,10);
nrows = fix(code/100);
if nrows*ncols < thisPlot
error(id('SubplotIndexTooLarge'),'Index exceeds number of subplots.');
end
kill_siblings = 1;
if(code == 111)
create_axis = false;
delay_destroy = true;
else
create_axis = true;
delay_destroy = false;
end end
elseif narg == 2 % The arguments MUST be the string 'position' and a 4-element vector: if(strcmpi(nrows, 'position'))
pos_size = size(ncols);
if(pos_size(1) * pos_size(2) == 4)
position = ncols;
explicitPosition = true;
else error(id('InvalidPositionParameter'),...
'Position must be of the form [left bottom width height].') end else error(id('UnknownOption'),'Unknown command option.') end
kill_siblings = 1; % Kill overlaps here also.
useAutoLayout = true;%hier habe ich von false auf true geändert
elseif narg == 3 % passed in subplot(m,n,p) -- we should kill overlaps % here too:
kill_siblings = 1;
elseif narg >= 4 if ~ischar(nrows)
arg = varargin{1};
if ~ischar(arg) % passed in subplot(m,n,p,H,...)
handle = arg;
parent = get(handle,'Parent');
parentfigure = ancestor(handle,'figure');
% If the parent is passed in explicitly, don't create a new figure % when the "NextPlot" property is set to "new" in the figure.
explicitParent = true;
set(parentfigure,'CurrentAxes',handle);
move_axis = true;
create_axis = false;
if narg >= 5 && strcmpi(varargin{2},'PreventMove')
preventMove = true;
pvpairs = varargin(3:end);
else
pvpairs = varargin(2:end);
end elseif strncmpi(arg,'replace',1) % passed in subplot(m,n,p,'replace')
kill_siblings = 2; % kill nomatter what elseifstrcmpi(arg,'align') % passed in subplot(m,n,p,'align') % since obeying position will remove the axes from the grid just set % useAutoLayout to false to skip adding it to the grid to start with
useAutoLayout = true;%hier habe ich von false auf true geändert
kill_siblings = 1; % kill if it overlaps stuff elseifstrcmpi(arg,'v6') % passed in subplot(m,n,p,'v6') % since obeying position will remove the axes from the grid just set % useAutoLayout to false to skip adding it to the grid to start with warning(['MATLAB:', mfilename, ':DeprecatedV6Argument'],... ['The ''v6'' argument to %s is deprecated,',...
' and will no longer be supported in a future release.'], upper(mfilename));
useAutoLayout = true;%hier habe ich von false auf true geändert
kill_siblings = 1; % kill if it overlaps stuff else % passed in prop-value pairs
kill_siblings = 1;
pvpairs = varargin;
par = find(strncmpi('Parent',pvpairs(1:2:end),6));
ifany(par) % If the parent is passed in explicitly, don't create a new figure % when the "NextPlot" property is set to "new" in the figure.
explicitParent = true;
parent = varargin{2*par(1)};
parentfigure = ancestor(parent,'figure');
end end else % Passed in "Position" syntax with P/V pairs % The arguments MUST be the string 'position' and a 4-element vector: if(strcmpi(nrows, 'position'))
pos_size = size(ncols);
if(pos_size(1) * pos_size(2) == 4)
position = ncols;
explicitPosition = true;
else error(id('InvalidPositionParameter'),...
'Position must be of the form [left bottom width height].') end else error(id('UnknownOption'),'Unknown command option.') end
kill_siblings = 1; % Kill overlaps here also.
useAutoLayout = true;%hier habe ich von false auf true geändert
pvpairs = [{thisPlot}varargin];
par = find(strncmpi('Parent',pvpairs(1:2:end),6));
ifany(par) % If the parent is passed in explicitly, don't create a new figure % when the "NextPlot" property is set to "new" in the figure.
explicitParent = true;
parent = pvpairs{2*par(1)};
parentfigure = ancestor(parent,'figure');
end end end
% if we recovered an identifier earlier, use it: if ~isempty(handle) && ~move_axis
parent = get(handle,'Parent');
parentfigure = ancestor(handle,'figure');
set(parentfigure,'CurrentAxes',handle);
else% if we haven't recovered position yet, generate it from mnp info: ifisempty(parent),
parent = gcf;
parentfigure = parent;
end ifisempty(position) ifmin(thisPlot) < 1 error(id('SubplotIndexTooSmall'),'Illegal plot number.') elseifmax(thisPlot) > ncols*nrows
error(id('SubplotIndexTooLarge'),'Index exceeds number of subplots.');
else
row = (nrows-1) -fix((thisPlot-1)/ncols);
col = rem(thisPlot-1, ncols);
% get default axis position in normalized units % If we have checked this quanitity once, cache it. if ~isappdata(parentfigure,'SubplotDefaultAxesLocation') if ~strcmp(get(parentfigure,'defaultaxesunits'),'normalized')
tmp = axes;
set(tmp,'units','normalized')
def_pos = get(tmp,'position');
delete(tmp) else
def_pos = get(parentfigure,'DefaultAxesPosition');
end setappdata(parentfigure,'SubplotDefaultAxesLocation',def_pos);
else
def_pos = getappdata(parentfigure,'SubplotDefaultAxesLocation');
end
% kill overlapping siblings if mnp specifier was used:
nextstate = get(parentfigure,'nextplot');
ifstrncmp(nextstate,'replace',7)
nextstate = 'add';
elseifstrncmp(nextstate,'new',3)
kill_siblings = 1;%hier habe ich von 0 auf 1 geändert
end
if(kill_siblings) if delay_destroy
ifnargout error(id('TooManyOutputs'),...
'Function called with too many output arguments.') else set(parentfigure,'NextPlot','replace');
return end end
sibs = datachildren(parent);
newcurrent = [];
for i = 1:length(sibs) % Be aware that handles in this list might be destroyed before % we get to them, because of other objects' DeleteFcn callbacks... if(ishghandle(sibs(i),'axes'))
units = get(sibs(i),'Units');
sibpos = get(sibs(i),'Position');
% If a legend or colorbar has resized the axes, use the original axes % position as the "Position" property: if ~explicitPosition
ifisappdata(sibs(i),'LegendColorbarExpectedPosition') && ... isequal(getappdata(sibs(i),'LegendColorbarExpectedPosition'),get(sibs(i),'Position'))
inset = getappdata(sibs(i),'LegendColorbarOriginalInset');
ifisempty(inset) % during load the appdata might not be present
inset = get(get(sibs(i),'Parent'),'DefaultAxesLooseInset');
end
inset = offsetsInUnits(sibs(i),inset,'normalized',get(sibs(i),'Units'));
ifstrcmpi(get(sibs(i),'ActivePositionProperty'),'position')
pos = get(sibs(i),'Position');
loose = get(sibs(i),'LooseInset');
opos = getOuterFromPosAndLoose(pos,loose,get(sibs(i),'Units'));
ifstrcmp(get(sibs(i),'Units'),'normalized')
inset = [opos(3:4) opos(3:4)].*inset;
end
sibpos = [opos(1:2)+inset(1:2) opos(3:4)-inset(1:2)-inset(3:4)];
end end end if ~strcmp(units,'normalized')
sibpos = hgconvertunits(parentfigure,sibpos,units,'normalized',parent);
end intersect = 1;
if((position(1) >= sibpos(1) + sibpos(3)-tol) || ... (sibpos(1) >= position(1) + position(3)-tol) || ... (position(2) >= sibpos(2) + sibpos(4)-tol) || ... (sibpos(2) >= position(2) + position(4)-tol)) intersect = 0;
end ifintersect % position is the proposed position of an axes, and % sibpos is the current position of an existing axes. % Since the bounding boxes of position and sibpos overlap, % we must determine whether to delete the sibling sibs(i) % whose normalized position is sibpos.
% First of all, we check whether we must kill the sibling % "no matter what." if(kill_siblings == 2) delete(sibs(i));
% If the proposed and existing axes overlap exactly, we do % not kill the sibling. Rather we shall ensure later that % this sibling axes is set as the 'CurrentAxes' of its % parentfigure.
% Next we check for a partial overlap. elseif(any(abs(sibpos - position) > tol)) % The proposed and existing axes partially overlap. % Since the proposed and existing axes could each be % "grid-generated" or "explicitly-specified", we must % consider four possibilities for the overlap of % "proposed" vs. "existing", i.e. % (1) "grid-generated" vs. "grid-generated" % (2) "grid-generated" vs. "explicitly-specified" % (3) "explicitly-specified" vs. "grid-generated" % (4) "explicitly-specified" vs. "explicitly-specified"
% If the position of the proposed axes is % "explicitly-specified", then the only condition that % avoids killing the sibling is an exact overlap. % However, we know that the overlap is partial. if(explicitPosition) delete(sibs(i));
else % We know that the position of the proposed axes is % "grid-generated".
grid = getappdata(parent,'SubplotGrid');
% The SubplotGrid maintains an array of axes % handles, one per grid location. Axes that span % multiple grid locations do not store handles in % the SubplotGrid.
ifisempty(grid) || ~any(grid(:) == sibs(i)) || ... size(grid,1) ~= nrows || size(grid,2) ~= ncols || ...
~isscalar(row) || ~isscalar(col) % If the sibling cannot be found in the grid, we % kill the sibling. Otherwise, the proposed and % existing axes are "grid-generated". If we % are changing the size of the grid, we kill % the sibling. Otherwise, "thisPlot" may be a % vector of multiple grid locations, which % causes a partial overlap between the proposed % and existing axes, so we kill the sibling.
% This check recognizes that there may be % labels, colorbars, legends, etc. attached to % the existing axes that have affected its % position. In such a case, we do not kill the % sibling. delete(sibs(i));
end end end if ishghandle(sibs(i)) % if this axes overlaps the other one exactly then if ~isempty(newcurrent) && ishghandle(newcurrent) delete(newcurrent);
end
newcurrent = sibs(i);
end end end end if ~isempty(newcurrent) && ishghandle(newcurrent) set(parentfigure,'CurrentAxes',newcurrent);
create_axis = false;
end set(parentfigure,'NextPlot',nextstate);
end
% create the axis: if create_axis
ifstrcmp(nextstate,'new') && ~explicitParent
parent = figure;
parentfigure = parent;
end
ax = axes('units','normal','Position',position,...
'LooseInset',inset,'Parent',parent);
% TODO: Get axes to accept position args on command line set(ax,'units',get(double(parentfigure),'defaultaxesunits')) if useAutoLayout
addAxesToGrid(ax,nrows,ncols,row,col,position);
end if ~isempty(pvpairs) set(ax,pvpairs{:});
end elseif move_axis && ~preventMove
ax = handle;
units = get(handle,'units');
set(handle,'units','normal','Position',position,...
'LooseInset',inset,'Parent',parent);
set(handle,'units',units);
if useAutoLayout
addAxesToGrid(ax,nrows,ncols,row,col,position);
end if ~isempty(pvpairs) set(handle,pvpairs{:});
end else % this should only happen with subplot(H)
ax = get(parentfigure,'CurrentAxes');
end
% return identifier, if requested: if(nargout > 0)
theAxis = ax;
end
% Create subplot listeners to align plot boxes automatically function createListeners(p,axlisth) setappdata(p,'SubplotListeners',[])
fig = p;
if ~isequal(get(fig,'Type'),'figure')
fig = ancestor(fig,'figure');
end
list = [...
handle.listener(axlisth,findprop(axlisth(1),'Units'), ...% must be first
'PropertyPostSet',@axesUnitsPostSet);
handle.listener(axlisth,findprop(axlisth(1),'Units'), ...
'PropertyPreSet',@axesUnitsPreSet);
handle.listener(axlisth,findprop(axlisth(1),'Position'), ...
'PropertyPostSet',@axesMoved);
handle.listener(axlisth,findprop(axlisth(1),'ActivePositionProperty'), ...
'PropertyPreSet',@axesMoved);
handle.listener(axlisth,findprop(axlisth(1),'Parent'), ...
'PropertyPreSet',@axesMoved);
handle.listener(axlisth,'AxisInvalidEvent',{@subplotlayoutInvalid,p});
handle.listener(handle(fig),'FigureUpdateEvent',{@subplotlayout,p})];
for k=1:length(axlisth)
ax = axlisth(k);
if ~isappdata(double(ax),'SubplotDeleteListener') setappdata(double(ax),'SubplotDeleteListener',...
handle.listener(ax,'ObjectBeingDestroyed', ...
@axesDestroyed));
end end setappdata(p,'SubplotListeners',list)
% Add ax to a matrix of handles in the specified location. % The grid is stored on the parent appdata. % Also store the insets in ax appdata. % Only stores the axes if it is in a 1-by-1 cell and % the grid size matches any existing grid. function addAxesToGrid(ax,nrows,ncols,row,col,position)
p = get(ax,'parent');
grid = getappdata(p,'SubplotGrid');
ifisempty(grid) grid = zeros(nrows,ncols);
end ifany(size(grid) ~= [nrows ncols]), return; end iflength(row) ~= 1 || length(col) ~= 1, return; end ifround(row) ~= row || round(col) ~= col, return; end ifgrid(row+1,col+1) == ax, return, end grid(row+1,col+1) = ax;
list = grid(:);
list(list == 0) = []; % remove root
list(~ishghandle(list)) = []; % remove invalid handles
createListeners(p,handle(list));
setappdata(p,'SubplotGrid',grid) setappdata(ax,'SubplotPosition',position); % normalized
subplotlayoutInvalid(handle(ax),[],p);
% Callback when axis moves to remove it from subplot layout grid function axesMoved(hSrc,evdata) %#ok
ax = double(evdata.affectedObject);
% If the legend or colorbar is causing the move, do not remove the axes % from the subplot grid. Do, however, update it's cached position: if(isappdata(ax,'inLayout') && ~isempty(getappdata(ax,'inLayout'))) || ... isappdata(ax,'LegendColorbarReclaimSpace') setappdata(ax,'SubplotPosition',get(ax,'Position'));
else
removeAxesFromGrid(get(ax,'Parent'),ax);
end
% Callback when axis changes units function axesUnitsPreSet(hSrc,evdata) %#ok
ax = double(evdata.affectedObject);
p = get(ax,'Parent');
list = getappdata(p,'SubplotListeners');
if ~isempty(list) set(list(2:end),'enable','off');
end
% Callback when axis done changing units function axesUnitsPostSet(hSrc,evdata) %#ok
ax = double(evdata.affectedObject);
p = get(ax,'Parent');
list = getappdata(p,'SubplotListeners');
if ~isempty(list) set(list(2:end),'enable','on');
end
% Callback when axis destroyed function axesDestroyed(hSrc,evdata) %#ok
ax = double(hSrc);
p = get(ax,'Parent');
ifstrcmp(get(p,'BeingDeleted'),'off')
removeAxesFromGrid(p,ax);
elseifisappdata(p,'SubplotListeners') rmappdata(p,'SubplotListeners');
rmappdata(p,'SubplotGrid');
end
%----------------------------------------------------------------%
% Convert units of offsets like LooseInset or TightInset % Note: Copied from legendcolorbarlayout.m function out = offsetsInUnits(ax,in,from,to)
fig = ancestor(ax,'figure');
par = get(ax,'Parent');
p1 = hgconvertunits(fig,[00 in(1:2)],from,to,par);
p2 = hgconvertunits(fig,[00 in(3:4)],from,to,par);
out = [p1(3:4) p2(3:4)];
%----------------------------------------------------------------%
% Compute reference OuterPos from pos and loose. Note that % loose insets are relative to outerposition % Note: Copied from legendcolorbarlayout.m function outer = getOuterFromPosAndLoose(pos,loose,units) ifstrcmp(units,'normalized') % compute outer width and height and normalize loose to them
w = pos(3)/(1-loose(1)-loose(3));
h = pos(4)/(1-loose(2)-loose(4));
loose = [w h w h].*loose;
end
outer = [pos(1:2)-loose(1:2) pos(3:4)+loose(1:2)+loose(3:4)];
Ja also danke für die Rückmeldung. Die Dokumentation hat mich ja erst auf die Idee mit der OuterPosition gebracht. Aber wie ich das dann definiere, verstehe ich noch nicht...
vielen Dank für deine Antwort. Ich habe das so jetzt erstmal importiert und jetzt wird nur noch ein Axes sozusagen angezeigt (nur das rechte). Aber ich vermute, dass das an meiner Schleife liegt , welche in meinem Programm enthalten ist:
ich muss das Thema leider doch nochmal aufrollen, denn mit AXES ist es dch noch nicht gelöst. Habe jetzt die Breite meiner Axes geändert und schon liegt das YLabel des jeweils rechteren Axes wieder im Axes des linkeren, also das in der Mitte wird von rechts überlagert und das ganz links wird vom mittleren überlagert.
Es muss doch möglich sein, dass man es so definiert, dass in meiner for-Schleife Axes1 ganz links positioniert wird und Axes1+i dann immer erst dort anfängt, wo das vorherige aufhört.
get_Spectogramm und show_Spectogramm sind zwei weitere vorgefertigte m-Files, bei denen ich aber nichts verändern darf.
Hat jemand einen Lösungsvorschlag?
Nochmal zu dem ActivePositionProperty: ich verstehe einfach nicht, wie man das eingeben muss, damit die einzelnen Axes inkl. deren Labels sich nicht mehr überlagern.
Bitte helft mir,
habt vielen Dank!
Euer Max
Edit: Wenn ich die Breite (Width) meiner Axes ändere, siehts schnell mal so wie im Anhang aus:
Renault Fluence Besch_0-30_gut ( 0.00-12.40 s).png
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.