Wolfram mathematica 有没有办法在mathematica中画出一组原点相同的直线?
我有以下几点:Wolfram mathematica 有没有办法在mathematica中画出一组原点相同的直线?,wolfram-mathematica,Wolfram Mathematica,我有以下几点: list1={3,1},{1,3},{-1,2},{-1,-1},{1,-2} 我想让Mathematica画一条从原点到上面所有点的线。换句话说,从原点(0,0)到上述集合中的所有单个点绘制向量。有办法做到这一点吗?到目前为止,我已经尝试了填充选项、绘图点和矢量绘图,但它们似乎无法实现我想要的功能 Graphics[ { Line[{{0, 0}, #}] & /@ list1 } ] 其中/@是函数映射的简写中缀符号 我想知道你为什么尝试填充,绘图点和
list1={3,1},{1,3},{-1,2},{-1,-1},{1,-2}代码>
我想让Mathematica画一条从原点到上面所有点的线。换句话说,从原点(0,0)到上述集合中的所有单个点绘制向量。有办法做到这一点吗?到目前为止,我已经尝试了填充
选项、绘图点
和矢量绘图
,但它们似乎无法实现我想要的功能
Graphics[
{
Line[{{0, 0}, #}] & /@ list1
}
]
其中/@
是函数映射的简写中缀符号
我想知道你为什么尝试填充
,绘图点
和矢量绘图
。我必须假设您根本没有阅读过文档,因为即使是肤浅的阅读也会告诉您,这些命令和选项与您正在寻找的功能无关。开始时很简单,然后难度增加:
Graphics[{Arrow[{{0, 0}, #}] & /@ list1}]
您还可以调整ListVectorPlot
,尽管我不明白为什么要这样做,因为它不打算这样使用:
list1 = {{3, 1}, {1, 3}, {-1, 2}, {-1, -1}, {1, -2}};
data = Table[{i/2, -i/Norm[i]}, {i, list1}];
ListVectorPlot[data, VectorPoints -> All,
VectorScale -> {1, 1, Norm[{#1, #2}] &},
VectorStyle -> {Arrowheads[{-.05, 0}]}]
Needs["PlotLegends`"];
list1 = {{3, 1}, {1, 3}, {-1, 2}, {-1, -1}, {1, -2}};
k = ColorData[22, "ColorList"][[;; Length@list1]];
GraphicsRow[{
Graphics[Riffle[k, Arrow[{{0, 0}, #}] & /@ #], Axes -> True],
Graphics@Legend[Table[{k[[i]], #[[i]]}, {i, Length@#}]]}] &@list1
Needs["PlotLegends`"];
list1 = {{3, 1}, {1, 3}, {-1, 2}, {-1, -1}, {1, -2}};
k = ColorData[22, "ColorList"][[;; Length@list1]];
ls = Sequence[Thick, Line[{{0, 0}, {1, 0}}]];
GraphicsRow[{
Graphics[Riffle[k, Arrow[{{0, 0}, #}] & /@ #], Axes -> True],
Graphics@Legend[MapThread[{Graphics[{#1, ls}], #2} &, {k, #}]]}] &@list1
Needs["PlotLegends`"];
list1 = {{3, 1}, {1, 3}, {-1, 2}, {-1, -1}, {1, -2}};
pr = {Min@#, Max@#} & /@ Transpose@list1;
k = ColorData[22, "ColorList"][[;; Length@list1]];
GraphicsRow[{
Graphics[r = Riffle[k, {Thick,Arrow[{{0, 0}, #}]} & /@ #], Axes -> True],
Graphics@
Legend[MapThread[
{Graphics[#1, Axes -> True, Ticks -> None, PlotRange -> pr],
Text@Style[#2, 20]} &,
{Partition[r, 2], #}]]}] &@list1
list1 = {{3, 1}, {1, 3}, {-1, 2}, {-1, -1}, {1, -2}};
data = Table[{i/2, -i/Norm[i]}, {i, list1}];
ListVectorPlot[data, VectorPoints -> All,
VectorScale -> {1, 1, Norm[{#1, #2}] &},
VectorStyle -> {Arrowheads[{-.05, 0}]}]