How to add lines in my plot?

8 ビュー (過去 30 日間)
Emmanouil - Nektarios Kalligeris
Emmanouil - Nektarios Kalligeris 2016 年 5 月 6 日
Hello. I have a plot and i want to display two lines ,one horizontal and one vertical ,so that both of them begin from 0. How can i do it?
My script:
plot(X(:,1),X(:,2),'ob',Y(:,1),Y(:,2),'or',0,0,'-k');
h = legend(wew3,wew4,2);
text(X(:,1)+.002,X(:,2)+.002,labels1,'Color',[0 0 1]);
text(Y(:,1)+.002,Y(:,2)+.002,labels2,'Color',[1 0 0]);
title('Plot');
xlabel(['1 ' num2str(1)';]);
ylabel(['2' num2str(2)';]);
Thank you

採用された回答

CS Researcher
CS Researcher 2016 年 5 月 6 日
Assuming the line length is L. You can do this:
line([0 0],[0 L]); hold on; line([0 L],[0 0]);
  1 件のコメント
Emmanouil - Nektarios Kalligeris
Emmanouil - Nektarios Kalligeris 2016 年 5 月 6 日
Thank you very much for your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by