Customize data cursor for 3D objects.
조회 수: 2 (최근 30일)
이전 댓글 표시
Let's say, I have many spheres drawn with surf/mesh.
I want to display customize data values rather than x,y,z. All values will be different for different spheres and clicking on any point on a particular sphere should display the same data. Refer figure. How do I achieve it?
So far, I'm thinking of using Surface property 'tag' to assign unique string to each sphere. Is there any better way to do it?
[x,y,z] = sphere;
a=[3 1 3 1];
s1=surf(x*a(1,4)+a(1,1),y*a(1,4)+a(1,2),z*a(1,4)+a(1,3),...
'FaceColor', [1 0 0],'FaceLighting','flat','EdgeColor','none');
s1.Tag = '1';
How should I proceed with custom datacursor function for custom functionality ?
댓글 수: 0
답변 (1개)
Ameer Hamza
2020년 6월 22일
See datatip() function: https://www.mathworks.com/help/matlab/ref/matlab.graphics.datatip.datatip.html. Also, see this example: https://www.mathworks.com/help/matlab/creating_plots/create-custom-data-tips.html
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!