Plotting only vertical part of line plot

조회 수: 1 (최근 30일)
aaron Harvey
aaron Harvey 2015년 10월 9일
편집: Eng. Fredius Magige 2015년 10월 9일
Hi,
I have a data set as two vectors X & Y. There are loads of repeats in X so that I have a series of Y values for the same x value (a vertical straight line).
e.g:
x y
1 0.1
1 0.2
1 0.3
1 0.4
2 0.0
2 0.1
2 0.1
2 0.3
2 0.4
3 0.2
3 0.3
5 0.4
5 0.5
5 0.4
5 0.6
I would like to plot X vs Y so that it plots a vertical line at 1,2,3,5 for the corresponding y values. However when I just plot XvsY the lines are joined up by diagonal lines which I don't want, and I don't want to separate out the individual series for each x value as my real data is too large and messy.
Thanks for any help.

답변 (1개)

Eng. Fredius Magige
Eng. Fredius Magige 2015년 10월 9일
the gplot function can help you as seem just X has connected Ys etc
  댓글 수: 2
aaron Harvey
aaron Harvey 2015년 10월 9일
but how would I create an adjacency matrix to do this?
Eng. Fredius Magige
Eng. Fredius Magige 2015년 10월 9일
편집: Eng. Fredius Magige 2015년 10월 9일
Hi If you data too huge you have to creat/code a function which control and generating adjacency matrix through major connection identified(sometimes you could have main to later lines). Note that then X&Y value will be attributes which supporting gplot function.

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

카테고리

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