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.

Create Elevation Profile and x-section from Given Latitude and Longidue using Online Tools

  1. Draw path/line on Google Earth, Google Maps or OpenStreet Maps.
  2. Save it as KML file
  3. Find the Altitude data for given latidute and logitude set.
  4. Plot Profile from online tool at gpsvisualizer website.
  5. If the line is perpendicular to main Profile line of road, it will be x-section of Natural Surface level.