小编Gab*_*iel的帖子

matlab就像Mathematica中的多线图

所以我有一个值矩阵,行对应于数据集,我想使用ListPlot绘制每一个,但我希望有一个不同于索引的x轴.在matlab中我会:

x = 0:4;

ys = [10 20 40 80 160; 
      20 40 80 160 320; 
      30 60 120 240 480]';

plot(x,ys)
Run Code Online (Sandbox Code Playgroud)

这将给出三行x值为0-4,y值为每列.

我在Mathematica中最接近的是

x = Range[0,4];

ys = {{10, 20, 40, 80, 160},
      {20, 40, 80, 160, 320},
      {30, 60, 120, 240, 480}};

ListPlot[Transpose[{x,#}]& /@ ys]
Run Code Online (Sandbox Code Playgroud)

Mathematica图形

这是正确的方法吗?这看起来有点神秘.希望有一个我缺少的功能或选项.

plot wolfram-mathematica

5
推荐指数
1
解决办法
751
查看次数

标签 统计

plot ×1

wolfram-mathematica ×1