How can I create this 2D waterfall plot?
古いコメントを表示
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?
5 件のコメント
Adam Danz
2019 年 4 月 11 日
What happens when you just plot out the data like this?
plot(time, data)
where 'time' is your time vector and 'data' is your 32-column matrix?
onamaewa
2019 年 4 月 11 日
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.
Update: a recent file exchange pick-of-the-week resembles a waterfall plot but does not resemble the image in the question.
採用された回答
その他の回答 (3 件)
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!
Vladimir
2020 年 9 月 21 日
0 投票
Try stackedplot built-in plotting routine
1 件のコメント
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.
Qiang
2024 年 8 月 2 日
0 投票
I guess these y data are in the roughtly same range and the demo figure is a stacked line by y offsets. This kind of figure is often used in comparison of the results of the same characterizaion technique on samples, like XRD, FT-IR, etc. For them, people dont pay much attention to the absolute intensities of each line, but the relative comparison between each. I sometimes use a trick in matlab that a constant value is incrementally added to the line so that each line can be offset in y-axis. I also wanted to know if there is a quick operation in matlab to realize that when plotting a matrix or table.
1 件のコメント
Rik
2024 年 8 月 2 日
If all your data is in a single matrix, you can use the + operator with implicit expansion to add a vector. Do you need an example implementation?
カテゴリ
ヘルプ センター および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!