guorui
guorui

Reputation: 891

How to plot a figure like this?

How to plot a figure like this

enter image description here

The data is like f(x_i,t_j), i=1,2,..,M, j=1,2,...,N. The horizontal axis is time t and vertical axis is space x

I know that mesh gives a 3-D plot and surf also gives 3-D surface, I wonder which command can give the above 2-D figure?

Upvotes: 0

Views: 73

Answers (1)

Mad Physicist
Mad Physicist

Reputation: 114310

To make a 2D heatmap, display your array as an image using imshow, and add a colorbar.

Upvotes: 2

Related Questions