Borrar filtros
Borrar filtros

Giving color to text labelled on curve

1 visualización (últimos 30 días)
Athira Surendran
Athira Surendran el 9 de Feb. de 2017
Respondida: KSSV el 9 de Feb. de 2017
How can I change the color of a text labelled on a curve to the same color of that curve? (there are multiple curves on the same figure)
for i=1:m
plot(x,y(i,:));
text(x(5),y(i,5),[num2str(load(i)),'%']);
hold on;
end;

Respuesta aceptada

KSSV
KSSV el 9 de Feb. de 2017
clc ; clear all ;
x = 1:10 ;
y = rand(5,10) ;
for i=1:5
c = rand(1,3) ;
plot(x,y(i,:),'color',c);
text(x(5),y(i,5),[num2str((i)),'%'],'Color',c,'FontSize',14);
hold on;
end;

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by