用什麼軟體能畫出這樣的圖?


Mathematica大法好

之前的代碼有點臃腫,稍微修改了下

plott = ParametricPlot3D[{u/5, Sin[u], Cos[u]}, {u, 0, 6 [Pi]},

Axes -&> False, PlotStyle -&> Directive[Thick, Red]];

bkgd1 = ContourPlot3D[{y == 0, z == 0}, {x, 0, 6 [Pi]/5}, {y, -1.4,

1.4}, {z, -1.4, 1.4}, Mesh -&> None,

ContourStyle -&> RGBColor[0, 1, 0, .05],

BoundaryStyle -&> RGBColor[0, 1, 0, .2], Axes -&> False];

bkgd2 = ContourPlot3D[

y^2 + z^2 == 1, {x, 0, 6 [Pi]/5}, {y, -1, 1}, {z, -1, 1},

Mesh -&> None, ContourStyle -&> RGBColor[1, 0, 0, .05],

BoundaryStyle -&> RGBColor[1, 0, 0, .2], Axes -&> False];

{vvectors1, vvectors2} =

Table[Graphics3D[

Table[{Thickness[Medium], Arrowheads[Medium],

Arrow[{{u/5, 0, 0}, {u/5, Sin[u], Cos[u]}}]}, {u, 0, 6 [Pi],

6 [Pi]/i}]], {i, 12, 200, 178}];

sincos = ParametricPlot3D[{{u/5, 0, Cos[u]}, {u/5, Sin[u], 0}}, {u, 0,

6 [Pi]}, Axes -&> False,

PlotStyle -&> {Directive[RGBColor[0, 0, .5], Thickness[0.003]],

Directive[RGBColor[0, .5, 0], Thickness[0.003]]}];

xaxis = Graphics3D[{Thickness[0.005],

Arrow[{{0, 0, -1.4}, {0, 0, 1.4}}]}];

yaxis = Graphics3D[{Thickness[0.005],

Arrow[{{0, 1.4, 0}, {0, -1.4, 0}}]}];

zaxis = Graphics3D[{Thickness[0.005],

Arrow[{{0, 0, 0}, {4.5, 0, 0}}]}];

fig1 = Show[xaxis, yaxis, zaxis, plott, vvectors1, bkgd1, bkgd2,

sincos, Boxed -&> False, BoxRatios -&> {2.5, 1, 1},

ImageSize -&> Medium, ViewPoint -&> {1.3, -2.4, 2.}]

fig2 = Show[xaxis, yaxis, zaxis, plott, vvectors2, bkgd2,

Boxed -&> False, BoxRatios -&> {2.5, 1, 1}, ImageSize -&> Medium,

ViewPoint -&> {1.3, -2.4, 2.}]

圖:


其實MATLAB可以用自帶的quiver3作矢量,另外修改了下讓圓柱看起來更立體一些,和題主的原圖更接近點兒:

x = (0:2:300)/50;
y = -sin(x*pi); z = cos(x*pi);
[m,M] = cellfun(@(t)deal(min(t),max(t)),{x,y,z});
[yc,zc,xc] = cylinder(1,500); xc = xc*M(1);
figure("render","painter","color","w"), view(44,14), axis image ij off, hold on
line(x,y,z,"linewidth",2,"color","r")
line(xc",yc",zc","color",[1 0.7 0.7])
h = surface(xc,yc,zc,"facecolor","none","edgecolor","r","edgealpha",0.02);
quiver3(x,0*x,0*z,0*x,y,z,0,"k","linewidth",1,"maxhead",0.06);
quiver3([m(1) 0 0],[0 m(2) 0],[0 0 m(3)],...
[1.2*(M(1)-m(1)) 0 0],[0 1.3*(M(2)-m(2)) 0],[0 0 1.3*(M(3)-m(3))],0,...
"linewidth",2,"color","k","maxhead",0.08)

Mathematica也可以用ListVectorPlot3D來作


你挨matlab這問什麼軟體能畫這圖的意思就是想讓大家回答matlab能畫唄?

先去matlab官網下載一個 mArrow3.m,然後

cmap1=lines(8);

figure(1)

clf

hold on

y=0:0.01:5;

x=-sin(y*pi);

z=cos(y*pi);

%

fill3([0 0 0 0],[0 5 5 0],[-2 -2 2 2],cmap1(1,:),"linestyle","none")

fill3([2 -2 -2 2],[0 0 5 5],[0 0 0 0],cmap1(1,:),"linestyle","none")

for i=1:200

fill3(x([0 0 1 1]+i),[0 5 5 0],z([0 0 1 1]+i),cmap1(1,:),"linestyle","none")

end

alpha(0.2)

axis off

mArrow3([2 0 0],[-2 0 0],"stemWidth",0.02,"tipWidth",0.08)

mArrow3([0 0 -2],[0 0 2],"stemWidth",0.02,"tipWidth",0.08)

mArrow3([0 0 0],[0 6 0],"stemWidth",0.02,"tipWidth",0.08)

set(gca,"xlim",[-2.5 2.5],"ylim",[0 5],"zlim",[-2.5 2.5])

view([122 18])

plot3(x,y,z,"linewidth",2,"color",cmap1(3,:))

plot3(x*0,y,z,"black")

plot3(x,y,z*0,"black")

for i=1:50:500

mArrow3([0 y(i) 0],[x(i) y(i) z(i)],"stemWidth",0.02,"tipWidth",0.06);

end

figure(2)

clf

hold on

axis off

mArrow3([2 0 0],[-2 0 0],"stemWidth",0.02,"tipWidth",0.08)

mArrow3([0 0 -2],[0 0 2],"stemWidth",0.02,"tipWidth",0.08)

mArrow3([0 0 0],[0 6 0],"stemWidth",0.02,"tipWidth",0.08)

set(gca,"xlim",[-2.5 2.5],"ylim",[0 5],"zlim",[-2.5 2.5])

view([122 18])

plot3(x,y,z,"linewidth",2,"color",cmap1(3,:))

for i=1:5:500

mArrow3([0 y(i) 0],[x(i) y(i) z(i)],"stemWidth",0.01,"tipWidth",0.04);

end


gnuplot可以,外面那圈用lines畫,裡面的箭頭用vectors畫。


我覺得 畫圖 也能畫出來,就看你有沒有耐心了


Solidworks


讓開,我是設計獅,我有話要說,用colordraw,複製偏移,分分鐘搞定


推薦閱讀:

為什麼Mathematica的DSolve函數會解不出顯式解??
為什麼Mathematica里矩陣索引這麼慢,有沒有什麼辦法迴避或者改進?

TAG:MATLAB | WolframMathematica | 繪圖軟體 |