필터 지우기
필터 지우기

How to Plot 1D Graph?

조회 수: 106 (최근 30일)
Jasnoor Singh
Jasnoor Singh 2016년 6월 24일
댓글: Dyuman Joshi 2023년 11월 24일
I want to plot a vertical or horizontal 1D graph. I have A = [22 23 24] and B = [5 6 7]. I want to represent these as discrete points along a single line, with the colors of points A and B different. Any suggestions please?
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2023년 11월 24일
Did you mean a 2D graph?
As a line is a 2D object.

댓글을 달려면 로그인하십시오.

답변 (2개)

KSSV
KSSV 2016년 6월 24일
A = [22 23 24] ;
B = [5 6 7] ;
plot(A,'-or') ;
hold on
plot(B,'-Ob') ;
legend({'A' ; 'B'})
  댓글 수: 3
KSSV
KSSV 2016년 6월 24일
How you can represent? If you want to show variation of A and B, you have to put other dimension. Do you have any rough idea in mind? Draw using paint and attach.
van hai dang
van hai dang 2019년 12월 24일
thank you for your support. I do not make the x axis like this, I would like to change values x axis to X1 X2 X3 according to yaxis value. Do you know how to do it. thank you

댓글을 달려면 로그인하십시오.


Arooj
Arooj 2023년 2월 26일

A=[22 23 24]; B=[5 6 7]; plot(A,'-or'); hold on plot(B,'-0b'); legend({'A';'B'})

  댓글 수: 1
Jens Peder Ulfkjær
Jens Peder Ulfkjær 2023년 11월 24일
It is still a 2D plot

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by