my code does not plot correct surface charge density for a (two parts) composite sphere. positive and negative charges must appear in pink and blue

Viewed 26

SCDD.png S_CHARGE_Density_D.mat polarmap.m

how can I modify my code to plot a two colors sphere (blue for negative charges and pink for positive charges and white for zero)? my colormap is polarmap, but the image that the code generates is not polar. would you please help me?

load('S_CHARGE_Density_D.mat') ;

X = X./1e-3 ; 
Y = Y./1e-3 ;
Z = Z./1e-3 ; 
Figure = figure('Name','SCDD','NumberTitle','off'); 

% Create axes 
axes1 = axes('Parent',figure); 
hold(axes1,'on'); 

colormap(axes1,'polarmap'); 

surf(X,Y,Z,SCDD,'Parent',axes1,'EdgeLighting','gouraud','EdgeColor','none'); 

colorbar(axes1) 

xlabel('x (mm)','FontWeight','bold'); 
ylabel('y (mm)','FontWeight','bold'); 
zlabel('z (mm)','FontWeight','bold'); 

title('SCDD','FontWeight','bold'); 

box(axes1,'on'); 
grid(axes1,'on'); 
axis(axes1,'tight'); 
view(axes1,-44,38); 
set(axes1,'DataAspectRatio',[1 1 1],...  
    'FontSize',12.5,'FontWeight','bold','Projection',...
    'perspective','XDir','reverse','YDir','reverse'); 

% savefig('SCDD.fig') 
0 Answers
Related