scatter function to set different color for particular point.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
sermet
el 1 de Mayo de 2015
Respondida: Star Strider
el 1 de Mayo de 2015
ids={'AKHR','AKSR','CIHA'};
x=[38.36927164;38.37038981;39.0791021];
y=[31.42974208;33.99814907;33.06536336];
figure(1),scatter(x, y, 'b^','LineWidth',4);grid on;
text(x, y, ids);
xlabel('Longtitude','fontsize',16);
ylabel('Latitude','fontsize',16);
%How do I set red color for point "CIHA" in figure 1 while the other points are blue.
0 comentarios
Respuesta aceptada
Star Strider
el 1 de Mayo de 2015
One possible way:
ids={'AKHR','AKSR','CIHA'};
x=[38.36927164;38.37038981;39.0791021];
y=[31.42974208;33.99814907;33.06536336];
figure(1),scatter(x(1:2), y(1:2), 'b^', 'LineWidth',4)
hold on
scatter(x(3),y(3),'^r', 'LineWidth',4)
hold off
grid on;
text(x, y, ids);
xlabel('Longtitude','fontsize',16);
ylabel('Latitude','fontsize',16);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!