How can I write the values of a colourmap on each object?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a mesh of triangular elements and a figure obtained with trisurf(tri,x,y,z). I insert the colorbar, where each colour represents the height z of triangles. Is it possible to write and display all the z values on the corresponding triangle?
0 Kommentare
Akzeptierte Antwort
KSSV
am 11 Nov. 2017
N = 10 ;
x = rand(N,1) ;
y = rand(N,1) ;
z = rand(N,1) ;
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
mx = mean(x(tri),2) ;
my = mean(y(tri),2) ;
mz = mean(z(tri),2) ;
trisurf(tri,x,y,z) ;
colorbar
view(2)
hold on
text(mx,my,mz,num2str(mz))
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Properties 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!