How can I fade Contour Lines on to the Binscatter plot?

2 vues (au cours des 30 derniers jours)
Syed Muhammad Asad Raza
Syed Muhammad Asad Raza le 2 Juin 2021
Commenté : darova le 7 Juin 2021
I want to fade the Contour Lines only over the places where Binscatter plot(yellow-red boxes) occurs.
Is there a way to fade the contour lines just over the Patches?
Here's the Code:
h = binscatter(nplot,tqplot)
c = colorbar('Ticks',[0 1400 2800],'TickLabels',{min_p,max_p/2 ,max_p})
c.Label.String = 'Percentage Time Consumption (%)';
colormap(flipud(hot))
contour(Ice.nFuCns_A,Ice.tqFuCns_A,Ice.bsfc',[180:5:200 210],'b','ShowText','on')
  2 commentaires
darova
darova le 5 Juin 2021
Can you extract the data fromo contour?
Syed Muhammad Asad Raza
Syed Muhammad Asad Raza le 5 Juin 2021
Yes Darova

Connectez-vous pour commenter.

Réponses (1)

darova
darova le 5 Juin 2021
You can extract edge of the region (yellow squares) using boundary
[y,x] = im2bw(A);
k = boundary(x,y);
Then use inpolygon to find data inside the region
ind = inpolygon(xq,yq,xv,yv);
  2 commentaires
Syed Muhammad Asad Raza
Syed Muhammad Asad Raza le 5 Juin 2021
How can I fade the blues contour lines over the Binscatter?
darova
darova le 7 Juin 2021
What about this?
t = [linspace(0,2*pi,20) nan]; % add NaN value to break face (patch)
[x1,y1] = pol2cart(t,1);
[x2,y2] = pol2cart(t,2);
x1 = x1 + 1.5;
ix = inpolygon(x1,y1,x2,y2); % find vertices inside the circle
plot(x1(ix),y1(ix),'.r')
patch(x1,y1,ix+1,'edgecolor','flat')% use patch to color line
line(x2,y2)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by