VGD
VGD

Reputation: 466

Contour line at specific value is not getting drawn

Using the following matrices

test1 =
[-0.200000000000000 -0.180000000000000  -0.160000000000000  -0.140000000000000  -0.120000000000000;
 -0.200000000000000 -0.180000000000000  -0.160000000000000  -0.140000000000000  -0.120000000000000];

test2 = 
[0.0153000000000000 0.0183000000000000  0.0212000000000000  0.0247000000000000  0.0281000000000000;
 0.0206000000000000 0.0227000000000000  0.0247000000000000  0.0273000000000000  0.0306000000000000];

test3 = 
[-2 -2  -2  -2  -2;
[-1 -1  -1  -1  -1];

(minified) I want to plot some contour lines like

figure
contour(test1,test2,test3,[value1, value2, ...],'ShowText','on');

However, the contour line for -2 is not being plotted, even when doing

figure
contour(test1,test2,test3,[-2 -2],'ShowText','on');

Any ideas?

Upvotes: 0

Views: 58

Answers (1)

Ander Biguri
Ander Biguri

Reputation: 35525

Yes, 2 ideas:

1) , is a separator, not the difference between decimal and integer places. your data is 0 and then 200000000000000. Probably not what you wanted. Replace those comas by ..

2) Once you have that, it should almost work. However, it doesnt work with -2 because that is on the limits, there is no boundary of -2 with something else. Try -1.5 for example, to see it working.

enter image description here

Upvotes: 2

Related Questions