Problem with countour plots - double lines around minimum area

1 view (last 30 days)
Hi, I am having a problem with contour plots. I have a 2D map of fuel consumption. x-axis is RPM, y-axis is BMEP. The map is highest around the edges, and lowest in the middle. Since it is composed of discrete levels (i.e. the values in the map have been rounded to known levels) and I want the contours to appear around those levels, I am using the following command to plot it:
contour(RPM, BMEP, map, unique(map));
This seems to work in some cases, but in others a double line appears around the inner most area (the lowest value on the map). I have simplified as much as I can below to show what I mean:
map =
600 600 600 600 600 600 600 600
600 600 600 600 600 600 600 600
600 600 600 600 600 600 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 200 200 200 200 600 600
600 600 600 600 600 600 600 600
600 600 600 600 600 600 600 600
600 600 600 600 600 600 600 600
figure;
contour(1000:500:4500, 0:18, map2, unique(map2))
What I expected to get: http://i.imgur.com/azY0j.png
I'd expect the contour at 600 to surround the entire plot, not to be placed on the same boundary as the contour at 200.
The double contour does not appear if there is a low value region surrounding the values (e.g. if all the 600s are replaced by zero in the above example).
Can someone explain what I'm doing wrong? Thanks.

Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!