Delete specific contour line from contour plot
Show older comments
I have made a contour plot, due to some reason unknown to me, there is one abnormality in the graph. One contour line is out of order, and I want to delete it. Kindly if someone can help or guide me to get rid of the contour line with ‘0’ markings. I am using the following code:
contour(X,Y,M,'ShowText','on');
here M is a matrix of size
and X & Y are also matrices of same size and obtained as
and X & Y are also matrices of same size and obtained as [X,Y]=meshgrid(x,y);
Following is the output

I am not an expert in MATLAB, maybe that's the reason I am unable to figure out the cause for the occurrence of this contour line. I’ve also attached the data matrix for this code.
Thanks a lot for your help.
Accepted Answer
More Answers (1)
You can read about the option of LevelList in the countour. YOu can provide only those levls which you want to plot. Read more in contour function.
In your case this should work:
contour(X,Y,M,'LevelList',0.1:0.1:9,'ShowText','on');

Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!