How can I make a “color map” plot in matlab?

前端 未结 4 549
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 17:16

I have some data (a function of two parameters) stored in a matlab format, and I\'d like to use matlab to plot it. Once I read the data in, I use mesh() to make

4条回答
  •  佛祖请我去吃肉
    2020-12-12 17:52

    I also suggest using contourf(Z). For my problem, I wanted to visualize a 3D histogram in 2D, but the contours were too smooth to represent a top view of histogram bars.

    So in my case, I prefer to use jucestain's answer. The default shading faceted of pcolor() is more suitable. However, pcolor() does not use the last row and column of the plotted matrix. For this, I used the padarray() function:

    pcolor(padarray(Z,[1 1],0,'post'))
    

    Sorry if that is not really related to the original post

提交回复
热议问题