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

11 Subplots plötzlich leer

 

livor
Forum-Newbie

Forum-Newbie


Beiträge: 2
Anmeldedatum: 02.08.19
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 02.08.2019, 14:10     Titel: 11 Subplots plötzlich leer
  Antworten mit Zitat      
Hallihallo und ich danke schon jetzt für eure Hilfe,

ich wollte gern 11 subplots anzeigen lassen. Das hat auch wunderbar funktioniert. Nun wollte ich den Subplots eigene Titel geben aber es werden zwar 11 Plots angezeigt aber nur 10 mit titel und diese 10 sind auch leer. In Plot 11 sind alle Graphen enthalten und kein titel Oo

komplette subplots ohne titel :

subplots(3, 4, ci)


fehlerhafte plots:

Code:


function final_yeast_plot(t,y,z)

for ci = 1:length(z)

subplot(3, 4, ci)
    subplot(3, 4, 1)
    title('Title 1')
    subplot(3, 4, 2)
    title('Title 2')
    subplot(3, 4, 3)
    title('Title 3')
    subplot(3, 4, 4)
    title('Title 4')
    subplot(3, 4, 5)
    title('Title 5')
    subplot(3, 4, 6)
    title('Title 6')
    subplot(3, 4, 7)
    title('Title 7')
    subplot(3, 4, 8 )
    title('Title 8')
    subplot(3, 4, 9)
    title('Title 9')
    subplot(3, 4, 10)
    title('Title 10')
    subplot(3, 4, 11)
    title('Title 11')

 plot(z{ci}(:,1),z{ci}(:,2),'r*') % experimental X
    hold on
    plot(z{ci}(:,1),z{ci}(:,6),'b*')
   plot(z{ci}(:,1),z{ci}(:,3),'bX')
    plot(z{ci}(:,1),z{ci}(:,4),'m*')
    plot(z{ci}(:,1),z{ci}(:,5),'k*')
    plot(t{ci},y{ci}(:,1),'r-')
    plot(t{ci},y{ci}(:,2),'b-')
    plot(t{ci},y{ci}(:,3),'g-')
    plot(t{ci},y{ci}(:,4),'b-')
    plot(t{ci},y{ci}(:,5),'m-')
    plot(t{ci},y{ci}(:,6),'k-')
    plot(t{ci},y{ci}(:,7),'c-')
    xlim([0 60])
    ylim([-1 100])
    xlabel('time [h]')
    ylabel('conc. [g/l]')
    title('Model')
    legend('bla1','bla2','bla3','bla4','bla5','bla6','bla7','bla8','bla9','bla10','bla11','bla12')
   
end
end


 


wo genau liegt mein fehler? Crying or Very sad

Danke

Inkedfehlerhafte subplots_LI.jpg
 Beschreibung:

Download
 Dateiname:  Inkedfehlerhafte subplots_LI.jpg
 Dateigröße:  436.08 KB
 Heruntergeladen:  293 mal
Private Nachricht senden Benutzer-Profile anzeigen


Harald
Forum-Meister

Forum-Meister


Beiträge: 24.448
Anmeldedatum: 26.03.09
Wohnort: Nähe München
Version: ab 2017b
     Beitrag Verfasst am: 02.08.2019, 23:42     Titel:
  Antworten mit Zitat      
Hallo,

ein Grafik-Befehl wird immer im zuletzt aktivierten subplot ausgeführt, sofern nicht explizit anders angegeben.
Wenn du nach dem title einen plot erstellt, setzt dieser den title zurück.
Du möchtest vermutlich:

Code:
for ci = 1:length(z)
subplot(3,4,ci)
 plot(z{ci}(:,1),z{ci}(:,2),'r*') % experimental X
    hold on
    plot(z{ci}(:,1),z{ci}(:,6),'b*')
   plot(z{ci}(:,1),z{ci}(:,3),'bX')
    plot(z{ci}(:,1),z{ci}(:,4),'m*')
    plot(z{ci}(:,1),z{ci}(:,5),'k*')
    plot(t{ci},y{ci}(:,1),'r-')
    plot(t{ci},y{ci}(:,2),'b-')
    plot(t{ci},y{ci}(:,3),'g-')
    plot(t{ci},y{ci}(:,4),'b-')
    plot(t{ci},y{ci}(:,5),'m-')
    plot(t{ci},y{ci}(:,6),'k-')
    plot(t{ci},y{ci}(:,7),'c-')
    xlim([0 60])
    ylim([-1 100])
    xlabel('time [h]')
    ylabel('conc. [g/l]')
   legend('bla1','bla2','bla3','bla4','bla5','bla6','bla7','bla8','bla9','bla10','bla11','bla12')
end
    subplot(3, 4, 1)
    title('Title 1')
    subplot(3, 4, 2)
    title('Title 2')
    subplot(3, 4, 3)
    title('Title 3')
    subplot(3, 4, 4)
    title('Title 4')
    subplot(3, 4, 5)
    title('Title 5')
    subplot(3, 4, 6)
    title('Title 6')
    subplot(3, 4, 7)
    title('Title 7')
    subplot(3, 4, 8 )
    title('Title 8')
    subplot(3, 4, 9)
    title('Title 9')
    subplot(3, 4, 10)
    title('Title 10')
    subplot(3, 4, 11)
    title('Title 11')


Grüße,
Harald
_________________

1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
Private Nachricht senden Benutzer-Profile anzeigen
 
livor
Themenstarter

Forum-Newbie

Forum-Newbie


Beiträge: 2
Anmeldedatum: 02.08.19
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 04.08.2019, 11:20     Titel:
  Antworten mit Zitat      
vielen dank es hat funktioniert Smile Very Happy Very Happy
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.