How to change the colors in the plot?

575 次查看(过去 30 天)
%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)');

采纳的回答

David Sanchez
David Sanchez 2013-8-1
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)');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by