A the surface x->-10:10, y->-10:10, z=0 to a plot of a curve in 3d (using plot3 in Matlab 2014b)?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Erez
el 21 de Oct. de 2018
Comentada: Star Strider
el 21 de Oct. de 2018
I have a curve in 3-dimensions, corresponding to
xx=0:9; yy=[-5:0 -1:-1:-4]; zz=[1:5 4:-1:0];
plot3(xx,yy,zz,'-o'); I wish to plot a semi-transparent surface corrseponding to x->-10:10, y->-10:10, z=0
How do I add this to the plot? I use Matlab 2014b.
In addition, is there a way to plot such that the axes and their origin will show up in the middle of the figure, and not in the sides?
Thank you!
1 comentario
jonas
el 21 de Oct. de 2018
Please do not spam your question. If anything, it makes some people (like me) less inclined to help.
Respuesta aceptada
Star Strider
el 21 de Oct. de 2018
Try this:
xx=0:9;
yy=[-5:0 -1:-1:-4];
zz=[1:5 4:-1:0];
figure
plot3(xx,yy,zz,'-o');
hold on
patch([-10 10 10 -10], [10 10 -10 -10], 'r', 'FaceAlpha',0.2)
hold off
grid on
‘... is there a way to plot such that the axes and their origin will show up in the middle of the figure, and not in the sides?’
Not in R2014b. I believe that was added in R2017b.
4 comentarios
jonas
el 21 de Oct. de 2018
Editada: jonas
el 21 de Oct. de 2018
Just to add:
"In addition, is there a way to plot such that the axes and their origin will show up in the middle of the figure, and not in the sides?"
ax = gca;
ax.ZRuler.FirstCrossoverValue = 0;
ax.ZRuler.SecondCrossoverValue = 0;
ax.XRuler.FirstCrossoverValue = 0;
ax.XRuler.SecondCrossoverValue = 0;
ax.YRuler.FirstCrossoverValue = 0;
ax.YRuler.SecondCrossoverValue = 0;
box on

Star Strider
el 21 de Oct. de 2018
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!