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

14 vues (au cours des 30 derniers jours)
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;

Réponses (2)

KSSV
KSSV le 6 Déc 2016
Modifié(e) : KSSV le 6 Déc 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 le 6 Déc 2016
If you're using release R2016b or later, the MarkerIndices property may be of interest to you.

Catégories

En savoir plus sur Results, Reporting, and Test File Management dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by