Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*Interactive code below for sampling*)
- Manipulate[
- points = Table[{x, Sin[x]}, {x, 0, 20 Pi, sample}];
- Show[
- Plot[Sin[x],
- {x, 0, 20 Pi},
- Epilog -> {Red, PointSize -> 0.02, Point[points]},
- PlotStyle -> Gray
- ],
- ListLinePlot[points, PlotStyle -> Red]
- ], {sample, 0.1, 2 Pi}
- ]
- (*Code for the row of sampling error examples*)
- points1 = Table[{x, Sin[x]}, {x, 0, 20 Pi, 0.25}];
- points2 = Table[{x, Sin[x]}, {x, 0, 20 Pi, 2.95}];
- points3 = Table[{x, Sin[x]}, {x, 0, 20 Pi, 2 Pi}];
- GraphicsRow[{
- Show[Plot[Sin[x], {x, 0, 20 Pi},
- Epilog -> {Red, PointSize -> 0.02, Point[points1]},
- PlotStyle -> Gray],
- ListLinePlot[points1, PlotStyle -> Red]
- ],
- Show[Plot[Sin[x], {x, 0, 20 Pi},
- Epilog -> {Red, PointSize -> 0.02, Point[points2]},
- PlotStyle -> Gray],
- ListLinePlot[points2, PlotStyle -> Red]
- ],
- Show[Plot[Sin[x], {x, 0, 20 Pi},
- Epilog -> {Red, PointSize -> 0.02, Point[points3]},
- PlotStyle -> Gray],
- ListLinePlot[points3, PlotStyle -> Red]
- ]
- }, ImageSize -> 1000]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement