plot a hexagonal figure
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
mohammad mortezaie
il 3 Ago 2021
Commentato: Adam Danz
il 18 Ago 2021
I need to plot a hexagonal figure like (a) part of this image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/701317/image.jpeg)
How can i do that?
Risposta accettata
Adam Danz
il 3 Ago 2021
th = linspace(0,2*pi,7) + pi/6;
x = sin(th);
y = cos(th);
figure()
tiledlayout(1,2)
nexttile()
plot(x,y,'k-o','markerSize',3,'MarkerFaceColor','k')
axis equal
axis padded
nexttile()
hold on
zDist = .3;
plot3(x(:)*[1,1],y(:)*[1,1],zDist.*[-.5,.5].*ones(numel(x),1),'k-')
plot3([1;1]*x(:)', [1;1]*y(:)',zDist.*[-.5,.5],'k-')
zlim([-1,1])
view(-50,15)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Lighting, Transparency, and Shading in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!