# Isosurface plots appear 2d when used with subplot

9 views (last 30 days)
Irem Altan on 22 Jun 2022
Commented: Irem Altan on 22 Jun 2022
Hi all,
I'm trying to put together some isosurface plots using subplot. I want them to be 3d and rotatable. However, when I try using subplot together with isosurface, the plots appear 2d and are not rotatable. What am I missing? Consider the following, for instance:
[x,y,z] = meshgrid([-3:0.25:3]);
V = x.*exp(-x.^2 -y.^2 -z.^2);
for i=1:4
subplot(2,2,i);
isosurface(x,y,z,V,1e-4);
end
##### 2 CommentsShowHide 1 older comment
Irem Altan on 22 Jun 2022
Thanks! This partially solves the problem. Things are now rotatable in a 3d view but the shading is still flat compared to a single plot.

William Rose on 22 Jun 2022
I find that if I click twice on the 3D rotate icon above each plot, I am able to rotate thenm. Here is a screenshot showing your four plots, with three of them rotated. Irem Altan on 22 Jun 2022
Thank you for trying that as well. At this point I'm not sure if this is a bug or something else. I have reached out to tech support and will see what they say.

Saksham Gupta on 22 Jun 2022
As per my understanding, you are telling that whole image is coming in 1 color only and not in shades as it comes for single plot.
On inputing x again as a parameter to isosurface, subplots should have the relevant shading.
For customizing colors and shading more, you should check out this documentation.
Below is the code I am using at my end :
[x,y,z] = meshgrid([-3:0.25:3]);
V = x.*exp(-x.^2 -y.^2 -z.^2);
for i=1:4
subplot(2,2,i);
isosurface(x,y,z,V,1e-4,x);
view(subplot(2,2,i),[10,10]);
end

R2021a

### Community Treasure Hunt

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

Start Hunting!