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

7 ビュー (過去 30 日間)
AbuYusuf
AbuYusuf 2016 年 12 月 6 日
回答済み: Steven Lord 2016 年 12 月 6 日
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;

回答 (2 件)

KSSV
KSSV 2016 年 12 月 6 日
編集済み: KSSV 2016 年 12 月 6 日
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 2016 年 12 月 6 日
If you're using release R2016b or later, the MarkerIndices property may be of interest to you.

カテゴリ

Help Center および File ExchangeResults, Reporting, and Test File Management についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by