user238469
user238469

Reputation:

How to depict the size/scale with grids in Matlab?

I have a figure that has 100 x 100 cells with associated length size of 20m x 100m for the total number of cells, respectively. I tried to plot the similar figure in Matlab, however, I could not plot the associated size i.e. 20m X 100m with the gridded data. I used the following code line to plot the gridded data in Matlab.

imagesc(variable)
colorbar

The Figure 1 plotted using Matlab looks like this:

Figure 1: enter image description here

How can I depict the size/scale of 20m x 100m in Figure 1? By size/scale, I do not mean putting co-ordinates on X and Y axis. Thanks.

Upvotes: 0

Views: 976

Answers (1)

Jonas
Jonas

Reputation: 74940

You can use the x and y argument in IMAGESC like so:

imagesc([1 100],[1 20],variable)
axis equal
axis tight

Upvotes: 1

Related Questions