Color a sphere surface/polar plot axis-wise
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there,
I would like to produce both a sphere and a polar plot whose surface color is defined at each XYZ axis as follows:
Top-bottom (Z) = blue
Left-right (Y) = red
Anterior-posterior (X) = green
The color in the boundaries/interfaces should be an interpolation of them.
Such as here:
and here (for the polar plot):
I have been googling for a while but did not find much help to do it.
Thanks,
Jon
PS: Similar questions seem to have been asked previously with a few variants, but the answers given seem not reproduce the figures pointed above.
0 Kommentare
Antworten (1)
Mike Garrity
am 12 Mai 2016
Something like this, perhaps?
[x,y,z] = sphere(40);
col(:,:,1) = abs(y);
col(:,:,2) = abs(x);
col(:,:,3) = abs(z);
surf(x,y,z,col,'FaceColor','interp','EdgeColor','none')
axis equal
camlight
Here's a start on the "polar" one, but I'll let you add the grid & text.
view(2)
axis off
set(gca,'CameraUpVector',[1 0 0])
delete(findobj(gca,'Type','light'))
1 Kommentar
Siehe auch
Kategorien
Mehr zu Surface and Mesh 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!