Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: How to create a contour map of 2D data?
Posted:
Feb 19, 2013 5:30 PM


On Wednesday, February 20, 2013 10:38:17 AM UTC+13, Maximilian wrote: > Hi there, > > > > I have 1000 pairs of angles which I want to plot on a contour map. In the regions with many similar pairs I want to have a certain colour lets say red and in regions with no pairs I want to have a green colour. In addition, I would like to be able to chose myself how many similar pairs are necessary for full red colour and what is still considered as similar. > > > > Basically the plot should look like this: > > > > http://www.betterlifelabs.org/aswb.gif > > > > It is basically the same idea as a Ramachandran plot which looks for angle pairs and its occurrence. How is this possible in Matlab? Thank you very much for your help.
You cannot have a 2D contour plot. By definition it is 3D. In your case, the 3rd dimension (presumably) is the number of points or the density (i.e. number of points per area unit). So, if you really want a contour plot, your problem is to figure out how you produce the 3rd dimension.
I assume by "pairs of angles", you actually mean pairs of longitude and latitude? I'd start by plotting your data in a 2D plot using symbols: plot(lon,lat,'bo') It may be that a contour plot is not what you want, but something like: help bar3



