How to assign a colour to particular value and rest of the values have their standard colours
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello ,
1.I want to assign a white colour to zero value and other than zeroth value (even the value just greater than zero. ex: 0.001,0.0001 ) should carry a colour which should represent their magnitude. I have created the plot by using contourf(x,y,z) by creating the meshgrid. The problem is, it is taking same colour to all the values which are almost equal to zero.
2. I also want to hide the axis values in meshgrid and also making the graph to exactly fit to the meshgrid.
Kindly help me. .
Thanks in advance.
0 Kommentare
Antworten (1)
Cris LaPierre
am 6 Mär. 2021
One solution I can think of is to replace all zeros with NaN. In a contour plot, NaNs display as white.
Z=meshgrid(-0.1:0.001:0.1);
% normal
contourf(Z)
% Change 0s to NaN
figure
Z(Z==0)=nan;
contourf(Z)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!