필터 지우기
필터 지우기

How to make a graph that shows evolution of a variable in time through different depths in a lake.

조회 수: 17 (최근 30일)
Hi all, I saw this graph a lot in papers (like the image below), but I do not have any idea how to make it in Matlab. I want to show a lake's temperature evolution through time in different depths, like the graph I attached. I have a matrix: Z=3705x38 matrix which shows data from 38 depth levels during 3705 days (each column is data from a sensor deployed in the depth of the lake). Please consider that the depth intervals are not the same and I want to show that is lake. so as in the picture, the x axis should be the time, the y axis should be depth and the graph legend shows the temperature range. Your advice will help me tons

채택된 답변

jonas
jonas 2018년 10월 20일
편집: jonas 2018년 10월 20일

Just create a surface object.

d  =  is your depth (1x38)
t  =  is your time (1x3705)
Te  =  is your temperature (3705x38)
surf(t,d,Te,'edgecolor','interp')
set(gca,'YDir','reverse')

simple as that. I would consider first changing the time to a datetime or duration array.

  댓글 수: 2
Marmar
Marmar 2018년 10월 20일
Thanks but it gives me a 3D plot, I need a 2D plot like the example I sent.
jonas
jonas 2018년 10월 20일
편집: jonas 2018년 10월 20일
set the view to
view([0 90])
I don't know why you spam the forum with this question. It's a very basic plot. You could also use pcolor, imagesc or contourf. The syntax is literally the same.
contourf(t,d,Te)
imagesc(t,d,Te)
pcolor(t,d,Te)
The image you uploaded is however not a contour plot. It is most likely a 3d plot.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2018년 10월 20일
I'd use imshow() with a colormap. If you need to digitize spatial data that is not yet on a regular grid, with values at every point, then you can use scatteredInterpolant. If you can't figure it out, attach your Z array in a .mat file.
  댓글 수: 1
Marmar
Marmar 2018년 10월 20일
Thanks, but it does not give me the data I want. I am sure I shoud use contourf, but I don't know how to use it :(

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

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by