How to colour a portion of a curve by red and remaining by black
I want to colour the lower portion of curve by red and broked curve and upper part of the curve by black as shown in the fig attached.
Code
clear all
format long
set(0,’DefaultAxesFontSize’,20);
figure
load(‘EP_EP(1).mat’,’x’); %load only x
idx = x(3,:)>=0.16 & x(3,:)<=0.305003;
plot(x(3,:),x(1,:),’k–‘, ‘LineWidth’,2); %middle unstable equilibria broken line
xlabel(‘$a$’,’FontSize’,20,’interpreter’,’latex’,’FontWeight’,’normal’,’Color’,’k’);
ylabel(‘$b$’,’FontSize’,20,’interpreter’,’latex’,’FontWeight’,’normal’,’Color’,’k’);
axis([0 .4 .3 1]);I want to colour the lower portion of curve by red and broked curve and upper part of the curve by black as shown in the fig attached.
Code
clear all
format long
set(0,’DefaultAxesFontSize’,20);
figure
load(‘EP_EP(1).mat’,’x’); %load only x
idx = x(3,:)>=0.16 & x(3,:)<=0.305003;
plot(x(3,:),x(1,:),’k–‘, ‘LineWidth’,2); %middle unstable equilibria broken line
xlabel(‘$a$’,’FontSize’,20,’interpreter’,’latex’,’FontWeight’,’normal’,’Color’,’k’);
ylabel(‘$b$’,’FontSize’,20,’interpreter’,’latex’,’FontWeight’,’normal’,’Color’,’k’);
axis([0 .4 .3 1]); I want to colour the lower portion of curve by red and broked curve and upper part of the curve by black as shown in the fig attached.
Code
clear all
format long
set(0,’DefaultAxesFontSize’,20);
figure
load(‘EP_EP(1).mat’,’x’); %load only x
idx = x(3,:)>=0.16 & x(3,:)<=0.305003;
plot(x(3,:),x(1,:),’k–‘, ‘LineWidth’,2); %middle unstable equilibria broken line
xlabel(‘$a$’,’FontSize’,20,’interpreter’,’latex’,’FontWeight’,’normal’,’Color’,’k’);
ylabel(‘$b$’,’FontSize’,20,’interpreter’,’latex’,’FontWeight’,’normal’,’Color’,’k’);
axis([0 .4 .3 1]); plot MATLAB Answers — New Questions