How to Plot 1D Graph?

54 次查看(过去 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?

回答(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'})

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by