How to change the color of my plots

2 ビュー (過去 30 日間)
Mojtaba Mohareri
Mojtaba Mohareri 2021 年 9 月 20 日
コメント済み: Mathieu NOE 2021 年 9 月 21 日
Hello everone,
I've plot my figure in matlab as follows
close all
clear all
avalues=0.3:0.01:1;
N=8000;
d=0.03;
a=avalues;
x=0.78;
y=0.81;
X=zeros(N,length(a));
Y=zeros(N,length(a));
for n=1:0.3*N
x=(1-d).*x.*exp(a.*(1-x).*((x/0.2)-1))+d.*y.*exp(a.*(1-y).*((y/0.2)-1));
y=(1-d).*y.*exp(a.*(1-y).*((y/0.2)-1))+d.*x.*exp(a.*(1-x).*((x/0.2)-1));
X(n,:)=x;
Y(n,:)=y;
end
figure (9), hold on
for n=.3*N:N
x=(1-d).*x.*exp(a.*(1-x).*((x/0.2)-1))+d.*y.*exp(a.*(1-y).*((y/0.2)-1));
y=(1-d).*y.*exp(a.*(1-y).*((y/0.2)-1))+d.*x.*exp(a.*(1-x).*((x/0.2)-1));
X(n,:)=x;
Y(n,:)=y;
plot(a,x,'.','MarkerSize',0.01)
hold on
plot(a,y,'.','MarkerSize',0.01)
axis([0.3 1 -1 1.4])
end
hold off
The output is
As we can seen, I have two figures on each other.
How can I change its color to the colors something like this?

採用された回答

Simon Chan
Simon Chan 2021 年 9 月 20 日
Just put the color code for the markers. May try the following:
for n=.3*N:N
x=(1-d).*x.*exp(a.*(1-x).*((x/0.2)-1))+d.*y.*exp(a.*(1-y).*((y/0.2)-1));
y=(1-d).*y.*exp(a.*(1-y).*((y/0.2)-1))+d.*x.*exp(a.*(1-x).*((x/0.2)-1));
X(n,:)=x;
Y(n,:)=y;
plot(a,x,'r.','MarkerSize',0.01)
hold on
plot(a,y,'b.','MarkerSize',0.01)
axis([0.3 1 -1 1.4])
end
  1 件のコメント
Mojtaba Mohareri
Mojtaba Mohareri 2021 年 9 月 20 日
Thank you very much for your help.

サインインしてコメントする。

その他の回答 (1 件)

Mathieu NOE
Mathieu NOE 2021 年 9 月 20 日
hello
I modified a bit your code to get this result :
.code :
close all
clear all
avalues=0.3:0.005:1;
N=200;
d=0.03;
a=avalues;
x=0.78;
y=0.81;
X=zeros(N,length(a));
Y=zeros(N,length(a));
for n=1:0.3*N
x=(1-d).*x.*exp(a.*(1-x).*((x/0.2)-1))+d.*y.*exp(a.*(1-y).*((y/0.2)-1));
y=(1-d).*y.*exp(a.*(1-y).*((y/0.2)-1))+d.*x.*exp(a.*(1-x).*((x/0.2)-1));
X(n,:)=x;
Y(n,:)=y;
end
figure (9), hold on
for n=.3*N:N
x=(1-d).*x.*exp(a.*(1-x).*((x/0.2)-1))+d.*y.*exp(a.*(1-y).*((y/0.2)-1));
y=(1-d).*y.*exp(a.*(1-y).*((y/0.2)-1))+d.*x.*exp(a.*(1-x).*((x/0.2)-1));
X(n,:)=x;
Y(n,:)=y;
plot(a,x,'r.','MarkerSize',15)
hold on
plot(a,y,'b.','MarkerSize',15)
end
axis([0.3 1 0 1.5])
hold off
  2 件のコメント
Mojtaba Mohareri
Mojtaba Mohareri 2021 年 9 月 21 日
Hello. I really appreciate.
Mathieu NOE
Mathieu NOE 2021 年 9 月 21 日
my pleasure

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by