How to change the colors in the plot?

1.394 visualizzazioni (ultimi 30 giorni)
Nawal
Nawal il 1 Ago 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)');

Risposta accettata

David Sanchez
David Sanchez il 1 Ago 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)');

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by