Best plot for representing matrix data

Hi there,
I'm trying to create a plot using a matrix of soil particle size data, and am having trouble choosing the best method. My matrix has rows representing the location of the samples in a riverbed, columns representing the depth of the samples, and data values representing the samples' average particle size. Ideally, I'd like the plot to feature the location on the x-axis, the depth on the y-axis, and the particle size represented by a color gradient, enabling viewers to easily observe trends as a function of both location and depth.
I originally tried using the surf() function - I clicked on the Rotate 3D button, right-clicked, and selected the "Go to X-Y View" option. That produced a nice plot, but when I tried to add a colorbar, the screen exploded with numbers and labels covering the plot area. I'm not sure if I need to configure the colorbar to avoid this issue, or use a different type of plot entirely. I'm quite new to MatLAB, so any suggestions would be very welcome.
I'll attach images of the plot with and without the colorbar; to clarify, the dark blue represents places without data - I used 0 values as placeholders (surf didn't like so many NaN values next to each other). Thanks so much for any help!

 採用された回答

Chad Greene
Chad Greene 2014 年 9 月 29 日

0 投票

I'd recommend imagesc. Or, pcolor deals with NaNs nicely, but pcolor and surf both delete a row and a column. Some entries in File Exchange fix that problem with pcolor.
Another option is to forget gridded plotting and simply use scatter.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

Jon
2014 年 9 月 29 日

コメント済み:

Jon
2014 年 9 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by