How can I create this 2D waterfall plot?

조회 수: 44 (최근 30일)
onamaewa
onamaewa 2019년 4월 11일
댓글: Adam Danz 2020년 9월 21일
The data is from a CSV file with one time column and 32 columns of data.
The curves show the Amplitude vs. Time behavior of the sensors while the sensor locations (in meters) are placed on the Y-axis.
I assume this is a waterfall plot, but I can't reproduce it. How can I make a graph like this one?
  댓글 수: 4
Adam Danz
Adam Danz 2019년 4월 11일
I don't know what "it didn't work" means. Does that mean you got at error? Does that mean the plot produced something unexpected?
Did you try the simple plot I suggested?
What do your data look like? How are they organized? Is each column of your matrix one of the lines that is represented in the graph you shared?
I'm working with virtually 0 information so it's hard to make suggestions or to help you without (much) more info.
Adam Danz
Adam Danz 2020년 5월 9일
편집: Adam Danz 2020년 5월 9일
Update: a recent file exchange pick-of-the-week resembles a waterfall plot but does not resemble the image in the question.

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

채택된 답변

Steven Lord
Steven Lord 2019년 4월 11일
That's not a waterfall plot, at least not by my understanding. To me a waterfall plot looks like the picture shown on the waterfall function documentation page.
What you've shown looks more like the "Plot Multiple Lines" or "Create Line Plot From Matrix" examples on the documentation page for the plot function, though your multiple lines look like their Y data is different enough that the lines don't overlap. In that I agree with Adam Danz, that plot is probably the right tool for this job.
If neither of those look like what you want, open the Plots tab on the Toolstrip and click the downward pointing triangle in the PLOTS section. Scan through the thumbnails to see if one looks like what you want. Once you've found such a thumbnail ask for help or doc on the function name written under the picture, or open up the Catalog (the button in the lower corner of the PLOTS dropdown) and locate the thumbnail / function of the same name to see the documentation page for that function.

추가 답변 (3개)

srt10
srt10 2019년 8월 29일
That plot does look like a waterfall plot. You can obtain a plot like that by trying
figure()
waterfall(time,position,data)
Here time is your time vector and position is a 1x32 vector that corresponds to each column of your data. Make sure the matrix "data" is of the correct dimensions (length(time) x 32). You may rotate the resulting waterfall plot to get what is shown in the figure. Good luck!

d7366431
d7366431 2020년 5월 9일
I am wondering what is the solution? How to obtain this chart? I have the same problem =)

Vladimir
Vladimir 2020년 9월 21일
Try stackedplot built-in plotting routine
  댓글 수: 1
Adam Danz
Adam Danz 2020년 9월 21일
The use of stackedplot is not a solution in this case because each line in the demo image extends into the territory of the next line along the y-axis. With stackedplot, each line would have its own ylim which would prevent overlaping.

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

카테고리

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