Question

I am trying to plot a surface AND it's wireframe with different properties. First I use ezsurf and I thought on top of that I could use ezmesh. However, it looks like ezmesh has white FaceColor and not transparent. I have tried to change that property but I haven't succeeded. This is my working example.

So, how to edit the properties of ezmesh?

clc;clear all; close all;
pmin=-.25*pi;
pmax=1.25*pi;
syms x t
%---Surface---%
figure(1)
n=60;
colormap([.95 .95 .95])
hold on
ezsurf((x-2)*cos(t),(x-2)*sin(t),x,[pmin,pmax,-.75,1],n)
ezsurf((x-2)*cos(t),(x-2)*sin(t),-x,[pmin,pmax,-.75,1],n)
ezsurf((-sqrt(1-x.^2)-3.41)*cos(t),(-sqrt(1-x.^2)-3.41)*sin(t),x,[pmin,pmax,-1,1],n)
ezsurf((sqrt(1-x.^2)-3.41)*cos(t),(sqrt(1-x.^2)-3.41)*sin(t),x,[pmin,pmax,0.75,1],n)
ezsurf((sqrt(1-x.^2)-3.41)*cos(t),(sqrt(1-x.^2)-3.41)*sin(t),x,[pmin,pmax,-1,-0.75],n)
shading interp
view(185,10)
axis equal
h=light('Position',[0 10 0])
%----------------%

%---Wireframe---%
%I'd like something as follows
%set(FromNowOn,'FaceColor','none','EdgeColor','k')
n=10;
ezmesh((x-2)*cos(t),(x-2)*sin(t),x,[pmin,pmax,-.75,1],n)
ezmesh((x-2)*cos(t),(x-2)*sin(t),-x,[pmin,pmax,-.75,1],n)
ezmesh((-sqrt(1-x.^2)-3.41)*cos(t),(-sqrt(1-x.^2)-3.41)*sin(t),x,[pmin,pmax,-1,1],n)
ezmesh((sqrt(1-x.^2)-3.41)*cos(t),(sqrt(1-x.^2)-3.41)*sin(t),x,[pmin,pmax,0.75,1],n)
ezmesh((sqrt(1-x.^2)-3.41)*cos(t),(sqrt(1-x.^2)-3.41)*sin(t),x,[pmin,pmax],[-1,-0.75],n)
%--------------%
Was it helpful?

Solution

Solution: Do not use ezmesh or ezsurf!!! Then life is nice.

enter image description here

clc;clear all; close all;
pmin=-.25*pi;
pmax=1.25*pi;
%---Surface---%
figure(1)
colormap([.65 .65 .65])
hold on
[x,t]=meshgrid(-.75:0.01:1,pmin:.1:pmax);
surf((x-2).*cos(t),(x-2).*sin(t),x)
surf((x-2).*cos(t),(x-2).*sin(t),-x)
[x,t]=meshgrid(-1:0.01:1,pmin:.1:pmax);
surf((-sqrt(1-x.^2)-3.41).*cos(t),(-sqrt(1-x.^2)-3.41).*sin(t),x)
[x,t]=meshgrid(.75:0.01:1,pmin:.1:pmax);
surf((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x)
[x,t]=meshgrid(-1:0.01:-.75,pmin:.1:pmax);
surf((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x)
shading interp
view(185,10)
axis equal
h=light('Position',[0 10 0])
%---------------------%

%-- Wireframe---%
[x,t]=meshgrid(-.75:0.25:1,pmin:.1:pmax);
mesh((x-2).*cos(t),(x-2).*sin(t),x,'Edgecolor','k','FaceColor','none')
mesh((x-2).*cos(t),(x-2).*sin(t),-x,'Edgecolor','k','FaceColor','none')
[x,t]=meshgrid(-1:0.1:1,pmin:.1:pmax);
mesh((-sqrt(1-x.^2)-3.41).*cos(t),(-sqrt(1-x.^2)-3.41).*sin(t),x,'Edgecolor','k','FaceColor','none')
[x,t]=meshgrid(.75:0.05:1,pmin:.1:pmax);
mesh((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x,'Edgecolor','k','FaceColor','none')
[x,t]=meshgrid(-1:0.05:-.75,pmin:.1:pmax);
mesh((sqrt(1-x.^2)-3.41).*cos(t),(sqrt(1-x.^2)-3.41).*sin(t),x,'Edgecolor','k','FaceColor','none')

%---------------%
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top