How can I display data with large absolute range in a 3D surface plot?

조회 수: 5 (최근 30일)
Bryan Cannon
Bryan Cannon 2019년 6월 11일
댓글: Star Strider 2019년 6월 12일
I've been trying to create a surface plot of data collected from a surface depth recording and am having trouble figuring out how to scale my Z data so it can fit on the plot. Not sure how to link the exact data (comes from an hd5 .datx file), but relevant info below:
  • The max range of my Z data is 1.7977e+308
  • x and y dimensions are a 1024 x 1024 meshgrid
[X, Y] = meshgrid(1:1024, 1:1024)
  • Attempting to run
surf(X, Y, Z)
  • I get a "Limits are too large" error
Any advice on what would be the best way to scale my Z data in order to dsipaly it on the surface plot? Thanks!

답변 (1개)

Star Strider
Star Strider 2019년 6월 11일
If all your Z data are greater than zero, taking the natural or base-10 logarithm could be an option, unless some other transformation is appropriate.
  댓글 수: 2
Bryan Cannon
Bryan Cannon 2019년 6월 12일
Mm I think I'd have to adjust the negative values I have. There seems to be an issue with the data conversion itself so I may need to figure out how to extract and convert the z data to a usable data type first. Appreciate the help!
Star Strider
Star Strider 2019년 6월 12일
My pleasure!
One option is to simply divide them by a constant, perhaps 1E+100.
Another is to use a modified version of the tanh function to scale the amplitudes:
x = linspace(-1E+300, 1E+300, 10);
y = 1E+100*tanh(x/1E+300);
figure
plot(x, y)

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by