How to separate two graphs plotted in one figure into two separate figures?
    12 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Soeun Lee
 el 6 de Ag. de 2021
  
    
    
    
    
    Respondida: Peter Perkins
    
 el 6 de Ag. de 2021
            Hi all,
What I am trying to do is to have one plot with the orange graph and another plot with the blue graph. However, right now the orange and blue graphs are being plotted together in one plot. How should I modify my code so that they are no longer plotted together in one plot?
Thanks in advance for your help.

2 comentarios
Respuesta aceptada
  Dave B
    
 el 6 de Ag. de 2021
        
      Editada: Dave B
    
 el 6 de Ag. de 2021
  
      Is neural.Spikes two columns?
If so:
figure; 
nexttile % starting in R2019b, in older versions subplot(1,2,1)
plot(neural.Time,neural.spikes(:,1))
nexttile % starting in R2019b, in older versions subplot(1,2,2)
plot(neural.Time,neural.spikes(:,2))
(If it's two rows, replace the (:,1) with (1,:) and (:,2) with (2,:))
Example:
t = 1:100;
spks = rand(100,2);
nexttile;
plot(t,spks(:,1))
nexttile
plot(t,spks(:,2))
0 comentarios
Más respuestas (1)
  Peter Perkins
    
 el 6 de Ag. de 2021
        If spikes were two separate variables in a timetable (see splitvars), this would just be stackedplot(neural).
0 comentarios
Ver también
Categorías
				Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.
			
	Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
