RE: Graphs of Sequences of Functions:(
- To: mathgroup at smc.vnet.net
- Subject: [mg46905] RE: [mg46900] Graphs of Sequences of Functions:(
- From: "David Park" <djmp at earthlink.net>
- Date: Sun, 14 Mar 2004 23:54:22 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Eleanna, How about... Needs["Graphics`Colors`"] Plot[Evaluate[Table[x^n, {n, 0, 10}]], {x, 0, 1}, PlotRange -> All, Frame -> True, FrameLabel -> {x, f}, RotateLabel -> False, PlotLabel -> SequenceForm[f == x^n, " as n goes from 0 to 10"], Background -> Linen, ImageSize -> 450]; We make a table of the functions. The Table has to be evaluated in the Plot statement for the Plot statement to work correctly. PlotRange -> All is necessary else Mathematica just shows what it thinks is the "interesting part". We obtain a better representation by using an uneven set of integers for n. How do we do that with a Table? We can't but we can do it with MapThread. For example... MapThread[x^#&,{{0, 1, 2, 3, 5, 10, 20, 50, 100}}] {1, x, x^2, x^3, x^5, x^10, x^20, x^50, x^100} MapThread is a way to make a table with arbitrary values. x^#& is a pure function. Then the following gives a more indicative plot. Plot[Evaluate[MapThread[x^# &, {{0, 1, 2, 3, 5, 10, 20, 50, 100}}]], {x, 0, 1}, PlotRange -> All, Frame -> True, FrameLabel -> {x, f}, RotateLabel -> False, PlotLabel -> SequenceForm[f == x^n, " for increasing n from 0 to 100"], Background -> Linen, ImageSize -> 450]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Eleanna Tsoumani [mailto:eleanna_tsoumani at yahoo.gr] To: mathgroup at smc.vnet.net Hi all, I am trying to do the graphs of some sequences of functions,using mathematica 4.0, in order to see if their convergence is uniform or not. For example : Fn(x) = x^n , 0=< x =<1. The problem is that the graphs have to be 2D (not 3D) but I cannot find a way to do that. Any suggestions? THANK YOU! Eleanna