
Whiteout/Remove some part of the contour plot
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Muhammad Usman
le 6 Nov 2019
Modifié(e) : Muhammad Usman
le 13 Avr 2020
I use the built-in MATLAB function "scatterInterpolant" to plot a contour. The plot is shown below.

It's s stress contour and the ellipse is an empty space and there are no nodes inside the ellipse. I want the ellipse to be whiteout. Somehow I managed to set the values inside the ellipse to be zero (because I can't delete them) and I got the following result

I want the ellipse to be whiteout. Any sort of help is highly appreciated. Thanks in advance.
P.S. I use the fill command to fill the ellipse with white color but that's not a proper way to do it.
0 commentaires
Réponse acceptée
Robert U
le 7 Nov 2019
Hi Muhammad Usman,
instead of assigning Zero to the nodes you don't want to use, apply "nan"-Values. That will be treated as if there is no value assigned and will be plotted with white color.
x = -100:100;
y = -100:100;
inputData = rand(201);
inputData(abs(x)<=10,abs(y)<=10) = nan;
contourf(x,y,inputData,'LineStyle','none');

Kind regards,
Robert
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Computational Geometry dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!