How to fix axes in dynamic plot
    17 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Bobby Fischer
      
 el 16 de Feb. de 2020
  
    
    
    
    
    Respondida: Giuseppe Inghilterra
      
 el 16 de Feb. de 2020
            Hi,
I would like to fix the axes in this dynamic plot right from the beginning. Is there an easy way to do it? 
Thank you.
close all
x=@(t)(sin(4*t)).^2;
y=@(t)cos(5*t);
z=pi;
figure(1)
for t=0:0.002:z
    plot(x(t),y(t),'.','MarkerSize',4,'color',[0,(t+z)/(2*z),(t+z)/(2*z)])
    hold on
    pause(eps)
end
0 comentarios
Respuesta aceptada
  Star Strider
      
      
 el 16 de Feb. de 2020
        Try this: 
x=@(t)(sin(4*t)).^2;
y=@(t)cos(5*t);
z=pi;
figure(1)
for t=0:0.002:z
    plot(x(t),y(t),'.','MarkerSize',4,'color',[0,(t+z)/(2*z),(t+z)/(2*z)])
    axis([0  1    -1  1])
    hold on
    pause(eps)
end
0 comentarios
Más respuestas (1)
  Giuseppe Inghilterra
      
 el 16 de Feb. de 2020
        Hi,
you can add in your code xlim and ylim functions
close all
x=@(t)(sin(4*t)).^2;
y=@(t)cos(5*t);
z=pi;
figure(1)
for t=0:0.002:z
    plot(x(t),y(t),'.','MarkerSize',4,'color',[0,(t+z)/(2*z),(t+z)/(2*z)])
    xlim([0 1])
    ylim([-1 1])
    hold on
    pause(eps)
end
0 comentarios
Ver también
Categorías
				Más información sobre Line Plots en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


