In MATLAB Plots, how can I add Circles, Crosses, Diamonds symbols to long data curves?

7 visualizaciones (últimos 30 días)
Hello folks,
I have a very huge y data that I want to plot, the problem I am facing is how to to add symbols to the some data of the curves because I want to avoid using colors and I want them to be clear for the reader? As you know if I use the simple method I'm using here these symbols will disappear due to the huge number of samples. Any help on this ?
here is the code I use:
load test.txt
x = test(:,1); x=x';
y1 = test(:,2); y1 = y1';
y2 = test(:,3); y2 = y2';
y3 = test(:,4); y3 = y3';
plot(x,y1,'--',x,y2,'-d',x,y3,'-o'); legend('V_x', 'V_1','V_2');
xlabel('Time (s)');ylabel('Voltage (v)');grid on;

Respuestas (2)

KSSV
KSSV el 6 de Dic. de 2016
Editada: KSSV el 6 de Dic. de 2016
You can follow some thing like this:
x = test(:,1); x=x';
y1 = test(:,2); y1 = y1';
y2 = test(:,3); y2 = y2';
y3 = test(:,4); y3 = y3';
quit = 5000 ;
plot(x(1:quit:end),y1(1:quit:end),'*r',x(1:quit:end),y2(1:quit:end),'bd',.......
x(1:quit:end),y3(1:quit:end),'go');
legend('V_x', 'V_1','V_2');
xlabel('Time (s)');ylabel('Voltage (v)');grid on;
hold on
plot(x,y1,'r',x,y2,'b',x,y3,'g');

Steven Lord
Steven Lord el 6 de Dic. de 2016
If you're using release R2016b or later, the MarkerIndices property may be of interest to you.

Categorías

Más información sobre Results, Reporting, and Test File Management en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by