Forgot password?
 Create new account
View 792|Reply 2

为什么这两个的效果不一样?

[Copy link]

2

Threads

4

Posts

48

Credits

Credits
48

Show all posts

热爱生命 Posted at 2018-9-9 17:12:48 |Read mode
Plot[Table[Sin[i x], {i, 1, 3}], {x, 0, Pi}]
Plot[{Sin[x], Sin[2 x], Sin[3 x]}, {x, 0, Pi}]
QQ截图20180909170859.png
这两个图画出来,一个是三个函数同样的颜色,另一个是三个函数三种颜色,这是为什么?用Table的话怎样调整才能变成三种颜色,试过PlotStyle是不行的。
我用的版本是11.1。

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2018-9-9 17:17:01
我也不知道为什么,不过解决倒是简单,只要分开两步就行,即:
Table[Sin[i x], {i, 1, 3}];
Plot[%, {x, 0, Pi}]

2

Threads

4

Posts

48

Credits

Credits
48

Show all posts

 Author| 热爱生命 Posted at 2018-11-17 20:44:02
无意中发现改成Plot[Evaluate[Table[Sin[n x], {n, 1, 3}]], {x, 0, Pi}]就可以了,不过还是不知道是什么原理。

手机版Mobile version|Leisure Math Forum

2025-4-20 22:06 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list