Borrar filtros
Borrar filtros

How to change the colors in the plot?

575 visualizaciones (últimos 30 días)
Nawal
Nawal el 1 de Ag. de 2013
%How to change the colors in the plot? %I have four curves, and they are black and blue,
%I'm trying to change the color to make it understandable.
plot(tt,xx(:,1),tt,xx(:,2));
grid on
xlabel('time')
ylabel ('Theta')
hold on
plot(ta,xa(:,1),ta,xa(:,2));
legend('theta(position 1)','thetadot(Velocity 1)','theta(position 2)','thetadot(Velocity 2)');

Respuesta aceptada

David Sanchez
David Sanchez el 1 de Ag. de 2013
plot(tt,xx(:,1),'b',,tt,xx(:,2),'r'); % one blue and the other red
grid on
xlabel('time')
ylabel ('Theta')
hold on
plot(ta,xa(:,1),'y',ta,xa(:,2),'k'); % one yellow one the other black
legend('theta(position 1)','thetadot(Velocity 1)','theta(position 2)','thetadot(Velocity 2)');

Más respuestas (0)

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by