WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

Abstand zwischen einzelnen Subplots vergrößern

 

champagnemomi
Forum-Anfänger

Forum-Anfänger


Beiträge: 10
Anmeldedatum: 18.07.17
Wohnort: ---
Version: R2015b
     Beitrag Verfasst am: 17.09.2018, 10:53     Titel: Abstand zwischen einzelnen Subplots vergrößern
  Antworten mit Zitat      
Hallo zusammen,

ich würde gerne den Abstand zwischen den einzelnen Subplots vergrößern, da die Überschriften immer sehr nahe an das vorherige Diagramm grenzen.
Habe bereits versucht den Trick mit der zweizeiligen Überschrift anzuwenden. Allerdings wird der Abstand in meinem Fall dadurch nicht vergrößert und die Überschrift rutscht in das nächste Diagramm.

Ich wäre sehr dankbar, wenn jemand einen weiteren Vorschlag hat dieses Problem zu lösen.


Danke und viele Grüße
Private Nachricht senden Benutzer-Profile anzeigen


Jan S
Moderator

Moderator


Beiträge: 11.057
Anmeldedatum: 08.07.10
Wohnort: Heidelberg
Version: 2009a, 2016b
     Beitrag Verfasst am: 17.09.2018, 11:32     Titel: Re: Abstand zwischen einzelnen Subplots vergrößern
  Antworten mit Zitat      
Hallo champagnemomi,

subplot ist nur ein Wrapper für einen Aufruf von axes . Du kannst das sehr leicht anpassen und die Position an Deine Wünsche anpassen.

Z.B.:
Code:
function AxisPos = moPlotPos(nCol, nRow, defPos)
% Position of diagrams - a very light SUBPLOT

% This is the percent offset from the subplot grid of the plotbox.
% Formula: Space = a + b * n
% Increase [b] to increase the space between the diagrams.

if nRow < 3
   BplusT = 0.18;
else
   BplusT = 0.09 + 0.045 * nRow;
end

if nCol < 3
   LplusR = 0.18;
else
   LplusR = 0.09 + 0.05 * nCol;
end

nPlot = nRow * nCol;
plots = 0:(nPlot - 1);
row   = (nRow - 1) - fix(plots(:) / nCol);
col   = rem(plots(:), nCol);

col_offset  = defPos(3) * LplusR / (nCol - LplusR);
row_offset  = defPos(4) * BplusT / (nRow - BplusT);

totalwidth  = defPos(3) + col_offset;
totalheight = defPos(4) + row_offset;
width       = totalwidth  / nCol - col_offset;
height      = totalheight / nRow - row_offset;

if width * 2 > totalwidth / nCol
   if height * 2 > totalheight / nRow
      AxisPos = [(defPos(1) + col * totalwidth / nCol), ...
            (defPos(2) + row * totalheight / nRow), ...
            width(ones(nPlot, 1), 1), ...
            height(ones(nPlot, 1), 1)];
   else
       AxisPos = [(defPos(1) + col * totalwidth / nCol), ...
            (defPos(2) + row * defPos(4) / nRow), ...
            width(ones(nPlot, 1), 1), ...
            (0.7 * defPos(ones(nPlot, 1), 4) / nRow)];
   end
else
   if height * 2 <= totalheight / nRow
      AxisPos = [(defPos(1) + col * defPos(3) / nCol), ...
            (defPos(2) + row * defPos(4) / nRow), ...
            (0.7 * defPos(ones(nPlot, 1), 3) / nCol), ...
            (0.7 * defPos(ones(nPlot, 1), 4) / nRow)];
   else
      AxisPos = [(defPos(1) + col * defPos(3) / nCol), ...
            (defPos(2) + row * totalheight / nRow), ...
            (0.7 * defPos(ones(nPlot, 1), 3) / nCol), ...
            height(ones(nPlot, 1), 1)];
   end
end

Gruß, Jan
Private Nachricht senden Benutzer-Profile anzeigen
 
Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

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
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2024 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

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.