Contour Plot using Matlab

You can plot contour map in Matlab. All you need is following:

  1. Download the zipped file of contourmatlab that contains m files, xls file of sample data and world mat file. The file is distributed under GNU/GPL v2.0 license.
  2. Extract the zipped file of contourmatlab to required directory.
  3. Open matlab and set your current directory of matlab to the extracted folder.
  4. Change the data in data.xls file to your own data. Remember that first column is latitude, second is longitude, both in decimals. While third column is value which you want to plot in contour. Same Latitude and Longitude should not repeat in rows.  For good contour plot, given data should be well distributed.
  5. In matlab command line, type:  plotcont
  6. Your contour will be plotted.
  7. To change the region of your plot or spacing of the plot data, you must edit plotcont.m file.

    Figure of Contour Plot on Pakistan Map.
    Fig1. Contour Plot on Pakistan Map.

You can use this file to plot the elevation contour of given region. All you need is to take latitude, longitude and elevation data for the required region. You can use google earth for this or if only elevation data is required then use online elevation profile.

One Reply to “Contour Plot using Matlab”

Leave a Reply