Why do the contour functions not return a contour at the minimum value of my Z data?

1 view (last 30 days)
I have a set of data for which I am trying to create a set of contours. I specify the minimum value of my Z data as one of the contour levels to create. However, a contour is not created at that level:
contourc(1:3,1:3,[1 0 1;0 1 0;1 0 1],[0 0])
ans =
Empty matrix: 2-by-0
If I specify the maximum value of the Z data as a contour level, it is created. Why isn't a contour produced at the minimum value?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
As a workaround, you can add EPS to the contour level, so it isn't exactly equal to the minimum value. For example:
contourc(1:3,1:3,[1 0 1;0 1 0;1 0 1],([0 0] + eps))

More Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!